Class RowsTransformBase<TDerived, TInput, TOutput, TError>
An abstract dataflow worker which repeatedly executes the
OnRowsAndDemandAsync()
method when there is both data to consume from the upstream worker and
RowsPerBuffer demand available from the downstream worker.
It also has an ErrorOutput port.
The library user must inherit this class and override
OnRowsAndDemandAsync 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 (without checking row
demand 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.
The input port uses the Default policy. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.
Use RowsTransformBase<TDerived, TInput, TOutput> instead if an ErrorOutput
port is not needed. Also see the
RowsTransformBase
example.
Inheritance
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class RowsTransformBase<TDerived, TInput, TOutput, TError> : RowsTransformBase<TDerived, TInput, TOutput>, IDisposeOnFinished where TDerived : RowsTransformBase<TDerived, TInput, TOutput, TError> where TInput : class where TOutput : class
Type Parameters
| Name | Description |
|---|---|
| TDerived | The type of the derived worker. Class definition example:
|
| TInput | The type of each |
| TOutput | The type of each |
| TError | The type of each |
Constructors
RowsTransformBase(in DownstreamFactory<TInput>, String, Boolean)
Initializes a new instance of the
RowsTransformBase<TDerived, TInput, TOutput> abstract dataflow
worker, which repeatedly executes a synchronous action when there is both
data to consume from the upstream worker and RowsPerBuffer
demand available from the downstream worker. The Output will be
automatically completed, if needed.
Declaration
protected RowsTransformBase(in DownstreamFactory<TInput> downstreamFactory, string workerName, bool autoCompleteOutput)
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TInput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to. Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>). |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Boolean | autoCompleteOutput |
|
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<TInput> ErrorOutput { get; }
Property Value
| Type | Description |
|---|---|
| ErrorOutputPort<TInput> |