Exemplo n.º 1
0
        protected override void DispatchRequest(MessageHeader messageHeader, TRequest request)
        {
            s_logger.LogDebug("MessagePump: Dispatching message {Id} from {ChannelName} on thread # {ManagementThreadId}", request.Id, Thread.CurrentThread.ManagedThreadId, Channel.Name);

            var messageType = messageHeader.MessageType;

            ValidateMessageType(messageType, request);

            switch (messageType)
            {
            case MessageType.MT_COMMAND:
            {
                CommandProcessorProvider.Get().Send(request);
                break;
            }

            case MessageType.MT_DOCUMENT:
            case MessageType.MT_EVENT:
            {
                CommandProcessorProvider.Get().Publish(request);
                break;
            }
            }
        }
Exemplo n.º 2
0
 private async void SendAsync(TRequest request)
 {
     await CommandProcessorProvider.Get().SendAsync(request, continueOnCapturedContext: true);
 }