Table of Contents

Class PipelineSegment<T>

Namespace
Pipelinez.Core.Segment
Assembly
Pipelinez.dll

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

T

The 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

Task

Logger

Gets the logger used by the segment.

protected ILogger<PipelineSegment<T>> Logger { get; }

Property Value

ILogger<PipelineSegment<T>>

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

options PipelineExecutionOptions

The 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

retryPolicy PipelineRetryPolicy<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

target IFlowDestination<PipelineContainer<T>>

The destination that should receive published output.

options DataflowLinkOptions

Optional 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

arg T

The 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.