public void EnqueueMessage(IRequestMessage requestMessage, IMessageResponseCollector responseCollector = null)
 {
     lock (_syncLock)
     {
         _unhandledMessages.Enqueue(requestMessage);
         _resultBuilders.Enqueue(responseCollector);
     }
 }
Ejemplo n.º 2
0
 public void Enqueue(IRequestMessage message1, IMessageResponseCollector responseCollector, IRequestMessage message2 = null)
 {
     try
     {
         Delegate.Enqueue(message1, responseCollector, message2);
     }
     catch (Exception e)
     {
         OnError(e);
     }
 }
Ejemplo n.º 3
0
        private void Enqueue(IRequestMessage requestMessage, IMessageResponseCollector resultBuilder = null,
                             IRequestMessage requestStreamingMessage = null)
        {
            _messages.Enqueue(requestMessage);
            _responseHandler.EnqueueMessage(requestMessage, resultBuilder);

            if (requestStreamingMessage != null)
            {
                _messages.Enqueue(requestStreamingMessage);
                _responseHandler.EnqueueMessage(requestStreamingMessage, resultBuilder);
            }
        }
Ejemplo n.º 4
0
        private void Enqueue(IRequestMessage requestMessage, IMessageResponseCollector resultBuilder = null, IRequestMessage requestStreamingMessage = null)
        {
            lock (_syncLock)
            {
                EnsureNotInterrupted();
                _messages.Enqueue(requestMessage);
                _responseHandler.EnqueueMessage(requestMessage, resultBuilder);

                if (requestStreamingMessage != null)
                {
                    _messages.Enqueue(requestStreamingMessage);
                    _responseHandler.EnqueueMessage(requestStreamingMessage, resultBuilder);
                }
            }
        }
Ejemplo n.º 5
0
 public void Run(string statement, IDictionary <string, object> paramters = null, IMessageResponseCollector resultBuilder = null, bool pullAll = true)
 {
     if (pullAll)
     {
         Enqueue(new RunMessage(statement, paramters), resultBuilder, new PullAllMessage());
     }
     else
     {
         Enqueue(new RunMessage(statement, paramters), resultBuilder, new DiscardAllMessage());
     }
 }
Ejemplo n.º 6
0
 public void Run(string statement, IDictionary <string, object> parameters = null, IMessageResponseCollector resultBuilder = null,
                 bool pullAll = true)
 {
     try
     {
         Delegate.Run(statement, parameters, resultBuilder, pullAll);
     }
     catch (Exception e)
     {
         OnError(e);
     }
 }
Ejemplo n.º 7
0
 public void Run(string statement, IDictionary <string, object> parameters = null, IMessageResponseCollector resultBuilder = null, bool pullAll = false)
 {
     _connection.Run(statement, parameters, resultBuilder, pullAll);
 }
 public void EnqueueMessage(IRequestMessage requestMessage, IMessageResponseCollector responseCollector = null)
 {
     _messageHandler.EnqueueMessage(requestMessage, responseCollector);
 }