Class PipelineDestination<T>
- Namespace
- Pipelinez.Core.Destination
- Assembly
- Pipelinez.dll
Provides a base implementation for pipeline destinations backed by a Dataflow buffer.
public abstract class PipelineDestination<T> : IPipelineDestination<T>, IFlowDestination<PipelineContainer<T>>, IPipelineExecutionConfigurable, IPipelineRetryConfigurable<T> where T : PipelineRecord
Type Parameters
TThe pipeline record type written by the destination.
- Inheritance
-
PipelineDestination<T>
- Implements
- Derived
- Inherited Members
Constructors
PipelineDestination()
Initializes a new destination base instance.
protected PipelineDestination()
Properties
Completion
Gets a task that completes when the destination has fully finished processing.
public Task Completion { get; }
Property Value
Logger
Gets the logger used by the destination.
protected ILogger<PipelineDestination<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.
ExecuteAsync(T, CancellationToken)
Executes the destination logic for a successfully processed record.
protected abstract Task ExecuteAsync(T record, CancellationToken cancellationToken)
Parameters
recordTThe record to write.
cancellationTokenCancellationTokenThe cancellation token for the execution.
Returns
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.
Initialize()
Provides an opportunity for the destination to initialize transport-specific state.
protected abstract void Initialize()
Initialize(Pipeline<T>)
Initializes the destination with its parent pipeline.
public void Initialize(Pipeline<T> parentPipeline)
Parameters
parentPipelinePipeline<T>The owning pipeline.
StartAsync(CancellationTokenSource)
Starts the destination execution loop.
public Task StartAsync(CancellationTokenSource cancellationToken)
Parameters
cancellationTokenCancellationTokenSourceThe runtime cancellation source used to stop the destination.