Class RowsSourceBase<TDerived, TOutput, TError>
An abstract dataflow worker which repeatedly executes the
OnOutputRowsDemandAsync()
method when there is RowsPerBuffer demand on the Output port.
It also has an ErrorOutput port. The library user must inherit this class and
override OnOutputRowsDemandAsync to provide custom functionality.
This class allows the developer to write synchronous or asynchronous code as needed,
without having to check for output demand (which simplifies the implementation, as long as
no more than RowsPerBuffer rows are sent on each invocation (or demand is checked for
explicitly).
The derived class can additionally override RunAsync()
to add logic that runs before and after all processing of rows, in which case the base class
base.RunAsync() must be called. The derived class (or its user) can also use
worker callbacks
to add logic.
Use RowsSourceBase<TDerived, TOutput> instead if an ErrorOutput port is not needed.
Also see the
RowsSourceBase
example.
Inheritance
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class RowsSourceBase<TDerived, TOutput, TError> : RowsSourceBase<TDerived, TOutput>, IDisposeOnFinished where TDerived : RowsSourceBase<TDerived, TOutput, TError> where TOutput : class where TError : class
Type Parameters
| Name | Description |
|---|---|
| TDerived | The type of the derived worker. Class definition example:
|
| TOutput | The type of each |
| TError | The type of each |
Constructors
RowsSourceBase(WorkerParent, String, Func<Boolean>)
Initializes a new instance of the RowsSourceBase<TDerived, TOutput, TError>
abstract dataflow worker, which repeatedly executes the OnOutputRowsDemandAsync
method when there is RowsPerBuffer demand on the Output port.
Declaration
protected RowsSourceBase(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
ErrorOutput
Gets the error output port for sending error rows to logging and an optional downstream worker.
Declaration
public ErrorOutputPort<TError> ErrorOutput { get; }
Property Value
| Type | Description |
|---|---|
| ErrorOutputPort<TError> |