Beispiel #1
0
 /// <summary>
 ///     Ends the pipeline by executing the provided endpoint. Defaults to <see cref="BatchHandlerPipelineEndpoint{T}" />
 /// </summary>
 public static void Run <T>(this IBatchPipelineBuilder <T> builder, Func <IReadOnlyCollection <Message <T> >, Task> action)
 {
     builder.Run(() =>
     {
         return((messages, cancellationToken, messageContext) => action(messages));
     });
 }
Beispiel #2
0
 /// <summary>
 ///     Adds the MediatR pipeline endpoint to the end of the pipeline
 /// </summary>
 public static void RunMediatR <T>(this IBatchPipelineBuilder <T> pipelineBuilder)
 {
     pipelineBuilder.Services.TryAddScoped <MediatRBatchPipelineEndpoint <T> >();
     pipelineBuilder.Run <MediatRBatchPipelineEndpoint <T> >();
 }