Exemple #1
0
        public MessageContext <T> New <T>(IExchangePublisher expPubl, byte[] data)
        {
            var datagram = Deserialize <T>(data);

            return(new MessageContext <T>()
            {
                RequestId = datagram.RequestId,
                Message = datagram.Message,
                SourceHost = datagram.SourceHost,
                SourceService = datagram.SourceService,
                PublishTimestamp = datagram.PublishTimestamp,
                ConversationId = datagram.ConversationId,
                Publisher = _publisherFactory.New(expPubl)
            });
        }
Exemple #2
0
        public async Task <TResult> CallAsync <TResult>(Func <TImpl, Publisher, Task <TResult> > caller)
        {
            var publ = _publisherFactory.New(_consumer.GetExchangePublisher());

            return(await caller(_impl.New(), publ));
        }