Exemplo n.º 1
0
        public OutputBlock(
            ILogger logger,
            Action <IFlow> successHandler)
        {
            CancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMinutes(1));
            var options = new ExecutionDataflowBlockOptions
            {
                CancellationToken      = CancellationTokenSource.Token,
                MaxDegreeOfParallelism = Environment.ProcessorCount,
                BoundedCapacity        = DataflowBlockOptions.Unbounded,
            };

            FailureBlock = new FailureBlock(logger, options);
            SuccessBlock = new SuccessBlock(logger, options, successHandler);
            Logger       = logger;
        }
Exemplo n.º 2
0
 void IDataflowBlock.Fault(Exception exception)
 {
     SuccessBlock.Fault(exception);
     FailureBlock.Fault(exception);
 }
Exemplo n.º 3
0
 void IDataflowBlock.Complete()
 {
     SuccessBlock.Complete();
     FailureBlock.Complete();
 }