Exemple #1
0
        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);
        }
Exemple #3
0
 void IProducerBlock <TInput> .Link(IReceiverBlock <TInput> receiverBlock)
 {
     _following = receiverBlock;
 }
Exemple #4
0
 void IProducerBlock <TOutput> .Link(IReceiverBlock <TOutput> receiverBlock)
 {
     _following = receiverBlock ?? throw new ArgumentNullException(nameof(receiverBlock), "Cannot be null");
 }
Exemple #5
0
 void IProducerBlock <ImmutableArray <TEntity> > .Link(IReceiverBlock <ImmutableArray <TEntity> > receiverBlock)
 {
     _next = receiverBlock ?? throw new ArgumentNullException(nameof(receiverBlock), "Cannot be null");
 }
Exemple #6
0
 void IConditionalProducerBlock <TInput, TInput> .LinkNegative(IReceiverBlock <TInput> receiverBlock)
 {
     _negative = receiverBlock;
 }
Exemple #7
0
 void IConditionalProducerBlock <TInput, TInput> .LinkPositive(IReceiverBlock <TInput> receiverBlock)
 {
     _positive = receiverBlock;
 }