コード例 #1
0
 /// <summary>
 /// Runs when any of <see cref="InputBlock"/>, <see cref="InnerBlock"/> or <see cref="OutputBlock"/> faults
 /// </summary>
 /// <param name="faultedTask">Completion property of the faulted DataflowBlock</param>
 private void OnAnyBlockFaulted(Task faultedTask)
 {
     // When one of the three DataflowBlocks faults, the faulted state is propagated to the following
     // DataflowBlocks, but not to the preceding DataflowBlocks. In this case we therefore fault all DataflowBlocks
     // that are not yet in a faulted state to ensure that all DataflowBlocks are completed and release their resources.
     if (!InputBlock.Completion.IsFaulted)
     {
         InputBlock.Fault(faultedTask.Exception);
     }
     if (!InnerBlock.Completion.IsFaulted)
     {
         InnerBlock.Fault(faultedTask.Exception);
     }
     if (!OutputBlock.Completion.IsFaulted)
     {
         OutputBlock.Fault(faultedTask.Exception);
     }
 }
コード例 #2
0
        internal SourceBlock(IPropagatorBlock <TOutput, TOutput> block)
        {
            if (block == null)
            {
                throw new ArgumentNullException("block");
            }

            _block = block;
            _task  = new Task(() => Produce(_block, _tokenSource.Token), TaskCreationOptions.LongRunning);
            _task.ContinueWith(t => _block.Fault(t.Exception), TaskContinuationOptions.OnlyOnFaulted);
        }
コード例 #3
0
 public void Fault(Exception exception)
 {
     _timeoutBlock.Fault(exception);
 }
コード例 #4
0
 public void Fault(Exception exception)
 {
     _block.Fault(exception);
 }
コード例 #5
0
        public void Fault_Calls_Underlying_Target_Block_Method()
        {
            _block.Fault(new Exception());

            _fakeBlock.Verify(b => b.Fault(It.IsAny <Exception>()), Times.Once());
        }
コード例 #6
0
 protected override void OnFault(Exception exception)
 {
     responseBuffer.Fault(exception);
     requestBuffer.Fault(exception);
 }
コード例 #7
0
 void IDataflowBlock.Fault(Exception exception) => _propagatorBlock.Fault(exception);
コード例 #8
0
 void IDataflowBlock.Fault(Exception exception)
 {
     bufferBlock.Fault(exception);
 }
コード例 #9
0
ファイル: Dataflow.cs プロジェクト: llenroc/ConcurrentFlows
 public void Fault(Exception exception)
 {
     internalBlock.Fault(exception);
 }
コード例 #10
0
 void IDataflowBlock.Fault(Exception exception)
 {
     output.Fault(exception);
 }
コード例 #11
0
 void IDataflowBlock.Fault(Exception exception)
 {
     transformRightBlock.Fault(exception);
     transformLeftBlock.Fault(exception);
 }
コード例 #12
0
 /// <summary>
 /// Causes the <see cref="T:System.Threading.Tasks.Dataflow.IDataflowBlock" /> to complete in a <see cref="F:System.Threading.Tasks.TaskStatus.Faulted" /> state.
 /// </summary>
 /// <param name="exception">The <see cref="T:System.Exception" /> that caused the faulting.</param>
 public void Fault(Exception exception)
 {
     _BatchBlock.Fault(exception);
 }
コード例 #13
0
 void IDataflowBlock.Fault(Exception exception)
 {
     internalBlock.Fault(exception);
 }
コード例 #14
0
        public void Fault(Exception exception)
        {
            _tokenSource.Cancel();

            _block.Fault(exception);
        }