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) }); }
public async Task <TResult> CallAsync <TResult>(Func <TImpl, Publisher, Task <TResult> > caller) { var publ = _publisherFactory.New(_consumer.GetExchangePublisher()); return(await caller(_impl.New(), publ)); }