Enqueue() public method

public Enqueue ( IEnumerable messages ) : void
messages IEnumerable
return void
示例#1
0
        public void HandleMessages(Message[] messages, CometAsyncResult asyncResult)
        {
            // Do this before we process the messages in case it's a disconnect
            Client sendingClient = GetSenderOf(messages);

            IMessagesProcessor processor = this.CreateProcessorAndProcess(messages);

            if (sendingClient == null)
            {
                asyncResult.CompleteRequestWithMessages(processor.Result);
                return;
            }

            if (sendingClient.CurrentAsyncResult != null)
            {
                sendingClient.FlushQueue();
            }

            sendingClient.CurrentAsyncResult = asyncResult;
            sendingClient.Enqueue(processor.Result);

            if (processor.ShouldSendResultStraightBackToClient)
            {
                sendingClient.FlushQueue();
            }
        }