/// <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); } }
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); }
public void Fault(Exception exception) { _timeoutBlock.Fault(exception); }
public void Fault(Exception exception) { _block.Fault(exception); }
public void Fault_Calls_Underlying_Target_Block_Method() { _block.Fault(new Exception()); _fakeBlock.Verify(b => b.Fault(It.IsAny <Exception>()), Times.Once()); }
protected override void OnFault(Exception exception) { responseBuffer.Fault(exception); requestBuffer.Fault(exception); }
void IDataflowBlock.Fault(Exception exception) => _propagatorBlock.Fault(exception);
void IDataflowBlock.Fault(Exception exception) { bufferBlock.Fault(exception); }
public void Fault(Exception exception) { internalBlock.Fault(exception); }
void IDataflowBlock.Fault(Exception exception) { output.Fault(exception); }
void IDataflowBlock.Fault(Exception exception) { transformRightBlock.Fault(exception); transformLeftBlock.Fault(exception); }
/// <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); }
void IDataflowBlock.Fault(Exception exception) { internalBlock.Fault(exception); }
public void Fault(Exception exception) { _tokenSource.Cancel(); _block.Fault(exception); }