Class PipelineBuilderExtensions
- Namespace
- CounterpointCollective.Dataflow.Fluent
- Assembly
- Dataflow.Composable.dll
public static class PipelineBuilderExtensions
- Inheritance
-
PipelineBuilderExtensions
- Inherited Members
Methods
Action<TFirst, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, Action<T>, ExecutionDataflowBlockOptions?)
Links an ActionBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, ActionBlock<T>> Action<TFirst, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, Action<T> a, ExecutionDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>aAction<T>optionsExecutionDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, ActionBlock<T>>
Type Parameters
TFirstT
Batch<TFirst, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, int, GroupingDataflowBlockOptions?)
Links a BatchBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, BatchBlock<T>> Batch<TFirst, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, int batchSize, GroupingDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>batchSizeintoptionsGroupingDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, BatchBlock<T>>
Type Parameters
TFirstT
Buffer<TFirst, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, DataflowBlockOptions?)
Links a BufferBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, BufferBlock<T>> Buffer<TFirst, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, DataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>optionsDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, BufferBlock<T>>
Type Parameters
TFirstT
BuildDataflowBlock<TInput>(IPipelineBuilder<IDataflowBlock, IDataflowBlock>)
Builds the pipeline as a single IDataflowBlock
public static IDataflowBlock BuildDataflowBlock<TInput>(this IPipelineBuilder<IDataflowBlock, IDataflowBlock> b)
Parameters
Returns
- IDataflowBlock
A block that encapsulates the entire pipeline.
Type Parameters
TInput
BuildSourceBlock<TOutput>(IPipelineBuilder<IDataflowBlock, ISourceBlock<TOutput>>)
Builds the encapsulated pipeline as a single ISourceBlock<TOutput>
public static ISourceBlock<TOutput> BuildSourceBlock<TOutput>(this IPipelineBuilder<IDataflowBlock, ISourceBlock<TOutput>> b)
Parameters
bIPipelineBuilder<IDataflowBlock, ISourceBlock<TOutput>>
Returns
- ISourceBlock<TOutput>
A block that encapsulates the entire pipeline.
Type Parameters
TOutput
BuildTargetBlock<TInput>(IPipelineBuilder<ITargetBlock<TInput>, IDataflowBlock>)
Builds the pipeline as a single ITargetBlock<TInput>
public static ITargetBlock<TInput> BuildTargetBlock<TInput>(this IPipelineBuilder<ITargetBlock<TInput>, IDataflowBlock> b)
Parameters
bIPipelineBuilder<ITargetBlock<TInput>, IDataflowBlock>
Returns
- ITargetBlock<TInput>
A block that encapsulates the entire pipeline.
Type Parameters
TInput
Build<TInput, TOutput>(IPipelineBuilder<ITargetBlock<TInput>, ISourceBlock<TOutput>>)
Builds the pipeline as a single IPropagatorBlock<TInput, TOutput>
public static IPropagatorBlock<TInput, TOutput> Build<TInput, TOutput>(this IPipelineBuilder<ITargetBlock<TInput>, ISourceBlock<TOutput>> b)
Parameters
bIPipelineBuilder<ITargetBlock<TInput>, ISourceBlock<TOutput>>
Returns
- IPropagatorBlock<TInput, TOutput>
A block that encapsulates the entire pipeline.
Type Parameters
TInputTOutput
Choice<TFirst, T, O>(IPipelineBuilder<TFirst, ISourceBlock<T>>, Predicate<T>, IPropagatorBlock<T, O>, IPropagatorBlock<T, O>, ExecutionDataflowBlockOptions?)
Links an choice block to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, ChoiceBlock<T, O>> Choice<TFirst, T, O>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, Predicate<T> predicate, IPropagatorBlock<T, O> thenBlock, IPropagatorBlock<T, O> elseBlock, ExecutionDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>predicatePredicate<T>thenBlockIPropagatorBlock<T, O>elseBlockIPropagatorBlock<T, O>optionsExecutionDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, ChoiceBlock<T, O>>
Type Parameters
TFirstTO
GroupAdjacent<TFirst, T, TKey>(IPipelineBuilder<TFirst, ISourceBlock<T>>, Func<T, TKey>, ExecutionDataflowBlockOptions, bool)
Links an GroupAdjacentBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, GroupAdjacentBlock<T, TKey, T>> GroupAdjacent<TFirst, T, TKey>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, Func<T, TKey> keySelector, ExecutionDataflowBlockOptions options, bool flushOnIdle = false) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>keySelectorFunc<T, TKey>optionsExecutionDataflowBlockOptionsflushOnIdlebool
Returns
- IPipelineBuilder<TFirst, GroupAdjacentBlock<T, TKey, T>>
Type Parameters
TFirstTTKey
GroupAdjacent<TFirst, T, TKey, TValue>(IPipelineBuilder<TFirst, ISourceBlock<T>>, Func<T, TKey>, Func<T, TValue>, ExecutionDataflowBlockOptions, bool)
Links an GroupAdjacentBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, GroupAdjacentBlock<T, TKey, TValue>> GroupAdjacent<TFirst, T, TKey, TValue>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, Func<T, TKey> keySelector, Func<T, TValue> valueSelector, ExecutionDataflowBlockOptions options, bool flushOnIdle = false) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>keySelectorFunc<T, TKey>valueSelectorFunc<T, TValue>optionsExecutionDataflowBlockOptionsflushOnIdlebool
Returns
- IPipelineBuilder<TFirst, GroupAdjacentBlock<T, TKey, TValue>>
Type Parameters
TFirstTTKeyTValue
LinkTo<TFirst, TNewLast, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, TNewLast, DataflowLinkOptions)
public static IPipelineBuilder<TFirst, TNewLast> LinkTo<TFirst, TNewLast, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, TNewLast nl, DataflowLinkOptions options) where TFirst : IDataflowBlock where TNewLast : ITargetBlock<T>
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>nlTNewLastoptionsDataflowLinkOptions
Returns
- IPipelineBuilder<TFirst, TNewLast>
Type Parameters
TFirstTNewLastT
LinkTo<TFirst, TNewLast, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, TNewLast, DataflowLinkOptions, Predicate<T>)
public static IPipelineBuilder<TFirst, TNewLast> LinkTo<TFirst, TNewLast, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, TNewLast nl, DataflowLinkOptions options, Predicate<T> predicate) where TFirst : IDataflowBlock where TNewLast : ITargetBlock<T>
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>nlTNewLastoptionsDataflowLinkOptionspredicatePredicate<T>
Returns
- IPipelineBuilder<TFirst, TNewLast>
Type Parameters
TFirstTNewLastT
Parallel<TFirst, TOutput>(IPipelineBuilder<TFirst, ISourceBlock<TOutput>>, IPropagatorBlock<TOutput, TOutput>[], GuaranteedBroadcastBlockOptions?)
Links a ParallelBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, ISourceBlock<TOutput>> Parallel<TFirst, TOutput>(this IPipelineBuilder<TFirst, ISourceBlock<TOutput>> p, IPropagatorBlock<TOutput, TOutput>[] blocks, GuaranteedBroadcastBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<TOutput>>blocksIPropagatorBlock<TOutput, TOutput>[]optionsGuaranteedBroadcastBlockOptions
Returns
- IPipelineBuilder<TFirst, ISourceBlock<TOutput>>
Type Parameters
TFirstTOutput
Parallel<TFirst, TInput, T1, T2, TOutput>(IPipelineBuilder<TFirst, ISourceBlock<TInput>>, IPropagatorBlock<TInput, T1>, IPropagatorBlock<TInput, T2>, Func<T1, T2, TOutput>, GuaranteedBroadcastBlockOptions?)
Links a ParallelBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, ISourceBlock<TOutput>> Parallel<TFirst, TInput, T1, T2, TOutput>(this IPipelineBuilder<TFirst, ISourceBlock<TInput>> p, IPropagatorBlock<TInput, T1> block1, IPropagatorBlock<TInput, T2> block2, Func<T1, T2, TOutput> f, GuaranteedBroadcastBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<TInput>>block1IPropagatorBlock<TInput, T1>block2IPropagatorBlock<TInput, T2>fFunc<T1, T2, TOutput>optionsGuaranteedBroadcastBlockOptions
Returns
- IPipelineBuilder<TFirst, ISourceBlock<TOutput>>
Type Parameters
TFirstTInputT1T2TOutput
Pipeline<TBlock>(TBlock)
Create a IPipelineBuilder wrapping the given dataflow block.
public static IPipelineBuilder<TBlock, TBlock> Pipeline<TBlock>(this TBlock block) where TBlock : IDataflowBlock
Parameters
blockTBlockThe dataflow block wrap by the IPipelineBuilder.
Returns
- IPipelineBuilder<TBlock, TBlock>
A new IPipelineBuilder<TFirst, TLast> representing the pipeline starting and ending with
block. This allows additional blocks to be appended fluently to build a larger pipeline, e.g. using methods likeTransformorTee.
Type Parameters
TBlockThe type of the dataflow block.
ResizableBuffer<TFirst, TOutput>(IPipelineBuilder<TFirst, ISourceBlock<TOutput>>, DataflowBlockOptions?, Action?)
Links a ResizableBuffer to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, ResizableBufferBlock<TOutput>> ResizableBuffer<TFirst, TOutput>(this IPipelineBuilder<TFirst, ISourceBlock<TOutput>> p, DataflowBlockOptions? options = null, Action? onEntered = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<TOutput>>optionsDataflowBlockOptionsonEnteredAction
Returns
- IPipelineBuilder<TFirst, ResizableBufferBlock<TOutput>>
Type Parameters
TFirstTOutput
SelectFirst<TFirst, TLast, TNew>(IPipelineBuilder<TFirst, TLast>, Func<TFirst, TNew>)
public static IPipelineBuilder<TNew, TLast> SelectFirst<TFirst, TLast, TNew>(this IPipelineBuilder<TFirst, TLast> p, Func<TFirst, TNew> f) where TFirst : IDataflowBlock where TLast : IDataflowBlock where TNew : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, TLast>fFunc<TFirst, TNew>
Returns
- IPipelineBuilder<TNew, TLast>
Type Parameters
TFirstTLastTNew
SelectLast<TFirst, TLast, TNew>(IPipelineBuilder<TFirst, TLast>, Func<TLast, TNew>)
public static IPipelineBuilder<TFirst, TNew> SelectLast<TFirst, TLast, TNew>(this IPipelineBuilder<TFirst, TLast> p, Func<TLast, TNew> f) where TFirst : IDataflowBlock where TLast : IDataflowBlock where TNew : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, TLast>fFunc<TLast, TNew>
Returns
- IPipelineBuilder<TFirst, TNew>
Type Parameters
TFirstTLastTNew
Select<TFirst, TLast, TNewFirst, TNewLast>(IPipelineBuilder<TFirst, TLast>, Func<IPipelineBuilder<TFirst, TLast>, IPipelineBuilder<TNewFirst, TNewLast>>)
public static IPipelineBuilder<TNewFirst, TNewLast> Select<TFirst, TLast, TNewFirst, TNewLast>(this IPipelineBuilder<TFirst, TLast> p, Func<IPipelineBuilder<TFirst, TLast>, IPipelineBuilder<TNewFirst, TNewLast>> f) where TFirst : IDataflowBlock where TLast : IDataflowBlock where TNewFirst : IDataflowBlock where TNewLast : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, TLast>fFunc<IPipelineBuilder<TFirst, TLast>, IPipelineBuilder<TNewFirst, TNewLast>>
Returns
- IPipelineBuilder<TNewFirst, TNewLast>
Type Parameters
TFirstTLastTNewFirstTNewLast
SubPipeline<TFirst, TLast, TNewLast>(IPipelineBuilder<TFirst, TLast>, Func<IPipelineBuilder<TLast, TLast>, TNewLast>)
Builds a sub-pipeline starting from the current last block and replaces the last block with the result of that sub-pipeline.
public static IPipelineBuilder<TFirst, TNewLast> SubPipeline<TFirst, TLast, TNewLast>(this IPipelineBuilder<TFirst, TLast> p, Func<IPipelineBuilder<TLast, TLast>, TNewLast> build) where TFirst : IDataflowBlock where TLast : IDataflowBlock where TNewLast : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, TLast>The current pipeline builder.
buildFunc<IPipelineBuilder<TLast, TLast>, TNewLast>A function that receives a sub-pipeline starting at
TLastand returns its final block.
Returns
- IPipelineBuilder<TFirst, TNewLast>
A new pipeline builder whose last block is the result of the sub-pipeline.
Type Parameters
TFirstThe first block type of the outer pipeline.
TLastThe current last block type, used as the start of the sub-pipeline.
TNewLastThe resulting last block type after the sub-pipeline.
SynchronousFilter<TFirst, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, Predicate<T>, FilterMode)
Wraps the last block of the current IPipelineBuilder in a SynchronousFilterBlock.
public static IPipelineBuilder<TFirst, SynchronousFilterBlock<T>> SynchronousFilter<TFirst, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, Predicate<T> predicate, FilterMode mode = FilterMode.Block) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>predicatePredicate<T>modeFilterMode
Returns
- IPipelineBuilder<TFirst, SynchronousFilterBlock<T>>
Type Parameters
TFirstT
SynchronousTransform<TFirst, T, O>(IPipelineBuilder<TFirst, ISourceBlock<T>>, Func<T, O>)
Wraps the last block of the current IPipelineBuilder in a SynchronousTransformingBlock.
public static IPipelineBuilder<TFirst, SynchronousTransformingBlock<T, O>> SynchronousTransform<TFirst, T, O>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, Func<T, O> transform) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>transformFunc<T, O>
Returns
- IPipelineBuilder<TFirst, SynchronousTransformingBlock<T, O>>
Type Parameters
TFirstTO
Tee<TFirst, I, T, O>(IPipelineBuilder<TFirst, ISourceBlock<I>>, IPropagatorBlock<I, T>, Func<I, T, O>, DataflowBlockOptions?)
Links an TeeBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, ISourceBlock<O>> Tee<TFirst, I, T, O>(this IPipelineBuilder<TFirst, ISourceBlock<I>> p, IPropagatorBlock<I, T> inner, Func<I, T, O> combinator, DataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<I>>innerIPropagatorBlock<I, T>combinatorFunc<I, T, O>optionsDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, ISourceBlock<O>>
Type Parameters
TFirstITO
TransformMany<TFirst, I, O>(IPipelineBuilder<TFirst, ISourceBlock<I>>, Func<I, IAsyncEnumerable<O>>, ExecutionDataflowBlockOptions?)
Links a TransformManyBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, TransformManyBlock<I, O>> TransformMany<TFirst, I, O>(this IPipelineBuilder<TFirst, ISourceBlock<I>> p, Func<I, IAsyncEnumerable<O>> f, ExecutionDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<I>>fFunc<I, IAsyncEnumerable<O>>optionsExecutionDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, TransformManyBlock<I, O>>
Type Parameters
TFirstIO
TransformMany<TFirst, I, O>(IPipelineBuilder<TFirst, ISourceBlock<I>>, Func<I, IEnumerable<O>>, ExecutionDataflowBlockOptions?)
Links a TransformManyBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, TransformManyBlock<I, O>> TransformMany<TFirst, I, O>(this IPipelineBuilder<TFirst, ISourceBlock<I>> p, Func<I, IEnumerable<O>> f, ExecutionDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<I>>fFunc<I, IEnumerable<O>>optionsExecutionDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, TransformManyBlock<I, O>>
Type Parameters
TFirstIO
TransformMany<TFirst, I, O>(IPipelineBuilder<TFirst, ISourceBlock<I>>, Func<I, Task<IEnumerable<O>>>, ExecutionDataflowBlockOptions?)
Links a TransformManyBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, TransformManyBlock<I, O>> TransformMany<TFirst, I, O>(this IPipelineBuilder<TFirst, ISourceBlock<I>> p, Func<I, Task<IEnumerable<O>>> f, ExecutionDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<I>>fFunc<I, Task<IEnumerable<O>>>optionsExecutionDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, TransformManyBlock<I, O>>
Type Parameters
TFirstIO
Transform<TFirst, I, O>(IPipelineBuilder<TFirst, ISourceBlock<I>>, Func<I, O>, ExecutionDataflowBlockOptions?)
Links a TransformBlock to the end of the current IPipelineBuilder.
public static IPipelineBuilder<TFirst, TransformBlock<I, O>> Transform<TFirst, I, O>(this IPipelineBuilder<TFirst, ISourceBlock<I>> p, Func<I, O> f, ExecutionDataflowBlockOptions? options = null) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<I>>fFunc<I, O>optionsExecutionDataflowBlockOptions
Returns
- IPipelineBuilder<TFirst, TransformBlock<I, O>>
Type Parameters
TFirstIO
WithNotification<TFirst, T>(IPipelineBuilder<TFirst, ISourceBlock<T>>, ConfigureHooks<T>)
Wraps the last block of the current IPipelineBuilder in a SourceBlockWithDeliveryNotification.
public static IPipelineBuilder<TFirst, NotifyingSourceBlock<T>> WithNotification<TFirst, T>(this IPipelineBuilder<TFirst, ISourceBlock<T>> p, ConfigureHooks<T> hooks) where TFirst : IDataflowBlock
Parameters
pIPipelineBuilder<TFirst, ISourceBlock<T>>hooksConfigureHooks<T>
Returns
- IPipelineBuilder<TFirst, NotifyingSourceBlock<T>>
Type Parameters
TFirstT