Class PipelineSegment<T>
Provides a base implementation for pipeline segments backed by a Dataflow transform block.
public abstract class PipelineSegment<T> : IPipelineSegment<T>, IFlowSource<PipelineContainer<T>>, IFlowDestination<PipelineContainer<T>>, IPipelineExecutionConfigurable, IPipelineRetryConfigurable<T> where T : PipelineRecord
Type Parameters
TThe pipeline record type processed by the segment.
- Inheritance
-
PipelineSegment<T>
- Implements
- Inherited Members
Constructors
PipelineSegment()
Initializes a new segment base instance.
public PipelineSegment()
Properties
Completion
Gets a task that completes when the segment has finished processing.
public Task Completion { get; }
Property Value
Logger
Gets the logger used by the segment.
protected ILogger<PipelineSegment<T>> Logger { get; }
Property Value
Methods
AsTargetBlock()
Gets the underlying Dataflow target block used to receive messages.
public ITargetBlock<PipelineContainer<T>> AsTargetBlock()
Returns
- ITargetBlock<PipelineContainer<T>>
The target block that should receive linked input.
ConfigureExecutionOptions(PipelineExecutionOptions)
Applies execution options to the component before it begins processing.
public void ConfigureExecutionOptions(PipelineExecutionOptions options)
Parameters
optionsPipelineExecutionOptionsThe execution options to apply.
ConfigureRetryPolicy(PipelineRetryPolicy<T>?)
Applies the retry policy that should be used for transient failures.
public void ConfigureRetryPolicy(PipelineRetryPolicy<T>? retryPolicy)
Parameters
retryPolicyPipelineRetryPolicy<T>The retry policy to use, or null to disable retries.
ConnectTo(IFlowDestination<PipelineContainer<T>>, DataflowLinkOptions?)
Connects the source to a downstream destination.
public IDisposable ConnectTo(IFlowDestination<PipelineContainer<T>> target, DataflowLinkOptions? options = null)
Parameters
targetIFlowDestination<PipelineContainer<T>>The destination that should receive published output.
optionsDataflowLinkOptionsOptional Dataflow link options applied to the connection.
Returns
- IDisposable
A disposable link handle that can be used to disconnect the source from the destination.
ExecuteAsync(T)
Executes the transformation performed by the segment.
public abstract Task<T> ExecuteAsync(T arg)
Parameters
argTThe record to transform.
Returns
- Task<T>
The transformed record.
GetExecutionOptions()
Gets the execution options currently configured for the component.
public PipelineExecutionOptions GetExecutionOptions()
Returns
- PipelineExecutionOptions
The active execution options.
GetRetryPolicy()
Gets the retry policy currently configured for the component.
public PipelineRetryPolicy<T>? GetRetryPolicy()
Returns
- PipelineRetryPolicy<T>
The configured retry policy, or null when retries are disabled.