Class PipelineBuilderExtensions
- Namespace
- CounterpointCollective.Dataflow.Fluent
- Assembly
- Dataflow.Fluent.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>>The pipeline builder.
optionsDataflowBlockOptionsOptional DataflowBlockOptions.
Returns
- IPipelineBuilder<TFirst, BufferBlock<T>>
A pipeline builder ending with a BufferBlock of T.
Type Parameters
TFirstThe first block type.
TThe type of items in the buffer.
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
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
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.
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.
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