예제 #1
0
        internal void ProcessesQueuedAsynchronousEvents()
        {
            Queue messages = this.GetQueue("*PendingNotifications").Messages;

            while (messages.Count > 0)
            {
                KeyValuePair <IComparable, EventQueueState> pair = (KeyValuePair <IComparable, EventQueueState>)messages.Dequeue();
                WorkflowTrace.Runtime.TraceInformation("Queuing Service: Processing delayed message notification '{0}'", new object[] { pair.Key.ToString() });
                for (int i = 0; (this.messageArrivalEventHandlers != null) && (i < this.messageArrivalEventHandlers.Count); i++)
                {
                    WorkflowQueuingService service = this.messageArrivalEventHandlers[i];
                    if (service.persistedQueueStates.ContainsKey(pair.Key))
                    {
                        EventQueueState queue = service.GetQueue(pair.Key);
                        if (queue.Enabled)
                        {
                            service.NotifyAsynchronousSubscribers(pair.Key, queue, 1);
                        }
                    }
                }
                this.NotifyAsynchronousSubscribers(pair.Key, pair.Value, 1);
            }
        }
        internal void ProcessesQueuedAsynchronousEvents()
        {
            Queue q = GetQueue(pendingNotification).Messages;

            while (q.Count > 0)
            {
                KeyValuePair <IComparable, EventQueueState> pair = (KeyValuePair <IComparable, EventQueueState>)q.Dequeue();
                // notify message arrived subscribers
                WorkflowTrace.Runtime.TraceInformation("Queuing Service: Processing delayed message notification '{0}'", pair.Key.ToString());
                for (int i = 0; messageArrivalEventHandlers != null && i < messageArrivalEventHandlers.Count; ++i)
                {
                    WorkflowQueuingService service = this.messageArrivalEventHandlers[i];
                    if (service.persistedQueueStates.ContainsKey(pair.Key))
                    {
                        EventQueueState qState = service.GetQueue(pair.Key);
                        if (qState.Enabled)
                        {
                            service.NotifyAsynchronousSubscribers(pair.Key, qState, 1);
                        }
                    }
                }
                NotifyAsynchronousSubscribers(pair.Key, pair.Value, 1);
            }
        }