void IProducerBlock <TEntity> .Link(IReceiverBlock <TEntity> receiverBlock) { if (receiverBlock == null) { throw new ArgumentNullException(nameof(receiverBlock), "Cannot be null"); } _targets.Add(receiverBlock); }
public static void Decision <TPrecedingOutput>( this IProducerBlock <TPrecedingOutput> precedingBlock, Func <CancellationToken, TPrecedingOutput, PipelineMetadata, Task <bool> > condition, IReceiverBlock <TPrecedingOutput> positive, IReceiverBlock <TPrecedingOutput> negative) { var next = new DecisionBlock <TPrecedingOutput>(condition); var conditional = (IConditionalProducerBlock <TPrecedingOutput, TPrecedingOutput>)next; conditional.LinkPositive(positive); conditional.LinkNegative(negative); precedingBlock.Link(next); }
void IProducerBlock <TInput> .Link(IReceiverBlock <TInput> receiverBlock) { _following = receiverBlock; }
void IProducerBlock <TOutput> .Link(IReceiverBlock <TOutput> receiverBlock) { _following = receiverBlock ?? throw new ArgumentNullException(nameof(receiverBlock), "Cannot be null"); }
void IProducerBlock <ImmutableArray <TEntity> > .Link(IReceiverBlock <ImmutableArray <TEntity> > receiverBlock) { _next = receiverBlock ?? throw new ArgumentNullException(nameof(receiverBlock), "Cannot be null"); }
void IConditionalProducerBlock <TInput, TInput> .LinkNegative(IReceiverBlock <TInput> receiverBlock) { _negative = receiverBlock; }
void IConditionalProducerBlock <TInput, TInput> .LinkPositive(IReceiverBlock <TInput> receiverBlock) { _positive = receiverBlock; }