Пример #1
0
        public Task PublishEventAsync(IEvent @event)
        {
            var message = new Message(@event, new Dictionary <string, string>());

            var ctx = new OutgoingPipelineContext();

            ctx.Save(message);

            return(_pielineInvoker.InvokeAsync(ctx));
        }
Пример #2
0
        private async Task ReceiverOnOnMessageReceived(object sender, TransportMessage transportMessage, Func <object, Task> commitAction)
        {
            var ctx = new ReceivePipelineContext();

            ctx.Save <TransportMessage>(transportMessage);
            ctx.Save <Func <Task> >(ReceivePipelineContext.CommitMessageAction, () => commitAction(sender));

            await _pipelineInvoker.InvokeAsync(ctx);
        }