예제 #1
0
 public FlowBlock(
     Func <TInput, ILogger, Task <TOutput> > transform,
     Func <Exception, LoggableException> exceptionHandler,
     OutputBlock outputBlock)
     : this(transform, exceptionHandler, new ExecutionDataflowBlockOptions(), outputBlock)
 {
 }
예제 #2
0
 public FlowBlock(
     Func <Flow <TInput>, ILogger, Flow <TOutput> > transform,
     ExecutionDataflowBlockOptions dataflowBlockOptions,
     OutputBlock outputBlock)
     : this(outputBlock)
 {
     this.TransformBlock = new TransformBlock <Flow <TInput>, Flow <TOutput> >(f => transform(f, this.Logger), dataflowBlockOptions);
 }
예제 #3
0
 public FlowBlock(
     Func <TInput, ILogger, Task <TOutput> > transform,
     Func <Exception, LoggableException> exceptionHandler,
     ExecutionDataflowBlockOptions dataflowBlockOptions,
     OutputBlock outputBlock)
     : this(outputBlock)
 {
     TransformBlock = new TransformBlock <Flow <TInput>, Flow <TOutput> >(
         async inFlow =>
     {
         try
         {
             return(new Flow <TOutput>(await transform(inFlow.Data, this.Logger)));
         }
         catch (Exception exception)
         {
             return(new Flow <TOutput>(exceptionHandler(exception)));
         }
     },
         dataflowBlockOptions);
 }
예제 #4
0
 /// <summary>
 /// Initizalizes a new instance of the CustomPropagatorBlock class with a
 /// logging API, used for writing log events and with an OutputBlock, used
 /// for error handling of a workflow.
 /// </summary>
 /// <param name="log">The Serilog.ILogging API, used for writing log events.</param>
 public RailBlock(OutputBlock outputBlock)
     : base(outputBlock.Logger)
 {
     this.OutputBlock = outputBlock;
 }
예제 #5
0
 /// <summary>
 //// Initizalizes a new instance of the FlowBlock class with a logging API,
 /// used for writing log events and with an OutputBlock, used for error handling
 /// of a workflow.
 /// </summary>
 /// <param name="log">The Serilog.ILogging API, used for writing log events.</param>
 private FlowBlock(OutputBlock outputBlock)
     : base(outputBlock)
 {
 }
예제 #6
0
 public FlowBlock(
     Func <Flow <TInput>, ILogger, Flow <TOutput> > transform,
     OutputBlock outputBlock)
     : this(transform, DefaultOptions, outputBlock)
 {
 }