Table of Contents

Class PipelineSourceBase<T>

Namespace
Pipelinez.Core.Source
Assembly
Pipelinez.dll

Provides a base implementation for pipeline sources backed by a Dataflow buffer.

public abstract class PipelineSourceBase<T> : IPipelineSource<T>, IFlowSource<PipelineContainer<T>>, IPipelineExecutionConfigurable where T : PipelineRecord

Type Parameters

T

The pipeline record type produced by the source.

Inheritance
PipelineSourceBase<T>
Implements
Derived
Inherited Members

Constructors

PipelineSourceBase()

Initializes a new source base instance.

public PipelineSourceBase()

Properties

Completion

Gets a task that completes when the source has finished publishing records.

public Task Completion { get; }

Property Value

Task

Logger

Gets the logger used by the source.

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

Property Value

ILogger<PipelineSourceBase<T>>

ParentPipeline

Gets the parent pipeline.

protected Pipeline<T> ParentPipeline { get; }

Property Value

Pipeline<T>

Methods

Complete()

Marks the source as complete so no additional records will be published.

public void Complete()

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.

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.

GetExecutionOptions()

Gets the execution options currently configured for the component.

public PipelineExecutionOptions GetExecutionOptions()

Returns

PipelineExecutionOptions

The active execution options.

Initialize()

Provides an opportunity for the source to initialize transport-specific state.

protected abstract void Initialize()

Initialize(Pipeline<T>)

Initializes the source with its parent pipeline.

public void Initialize(Pipeline<T> parentPipeline)

Parameters

parentPipeline Pipeline<T>

The owning pipeline.

MainLoop(CancellationTokenSource)

Executes the main source loop.

protected abstract Task MainLoop(CancellationTokenSource cancellationToken)

Parameters

cancellationToken CancellationTokenSource

The runtime cancellation source used to stop the source.

Returns

Task

A task that completes when the source loop exits.

OnPipelineContainerComplete(object, PipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>>)

Handles notification that a published container completed successfully.

public virtual void OnPipelineContainerComplete(object sender, PipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>> e)

Parameters

sender object

The event sender.

e PipelineContainerCompletedEventHandlerArgs<PipelineContainer<T>>

The completed container event arguments.

PublishAsync(T)

Publishes a record using the pipeline's default flow-control behavior.

public Task PublishAsync(T record)

Parameters

record T

The record to publish.

Returns

Task

PublishAsync(T, PipelinePublishOptions)

Publishes a record using explicit publish options.

public Task<PipelinePublishResult> PublishAsync(T record, PipelinePublishOptions options)

Parameters

record T

The record to publish.

options PipelinePublishOptions

The publish options to apply.

Returns

Task<PipelinePublishResult>

The publish result.

PublishAsync(T, MetadataCollection)

Publishes a record with explicit metadata using the pipeline's default flow-control behavior.

public Task PublishAsync(T record, MetadataCollection metadata)

Parameters

record T

The record to publish.

metadata MetadataCollection

The metadata to attach to the record.

Returns

Task

PublishAsync(T, MetadataCollection, PipelinePublishOptions)

Publishes a record with explicit metadata and publish options.

public Task<PipelinePublishResult> PublishAsync(T record, MetadataCollection metadata, PipelinePublishOptions options)

Parameters

record T

The record to publish.

metadata MetadataCollection

The metadata to attach to the record.

options PipelinePublishOptions

The publish options to apply.

Returns

Task<PipelinePublishResult>

The publish result.

StartAsync(CancellationTokenSource)

Starts the source execution loop.

public Task StartAsync(CancellationTokenSource cancellationToken)

Parameters

cancellationToken CancellationTokenSource

The runtime cancellation source used to stop the source.

Returns

Task