public static MessagePipelineBuilder AddHandler(this MessagePipelineBuilder builder, Action <Message, string, int> action)
        {
            return(builder.AddHandler(new GenericMessageHandler((msg, pipelineName, index) =>
            {
                action(msg, pipelineName, index);

                return Task.FromResult(MessageHandlerResults.Success);
            })));
        }
 public static MessagePipelineBuilder AddHandler(this MessagePipelineBuilder builder, Func <Message, Task <MessageHandlerResults> > asyncFunc)
 {
     return(builder.AddHandler(new GenericMessageHandler((msg, pipelineName, index) => asyncFunc(msg))));
 }
 public static MessagePipelineBuilder AddHandler(this MessagePipelineBuilder builder, Func <Message, string, int, Task <MessageHandlerResults> > asyncFunc)
 {
     return(builder.AddHandler(new GenericMessageHandler(asyncFunc)));
 }