Class TransformBase<TDerived, TInput, TOutput>
An abstract dataflow worker with one Input and one Output port, which can be
used to create a dataflow transform. The library user must inherit this class and override
the RunAsync() method (which will get called once) to add custom functionality.
This method should in turn call methods on the Input port to consume rows from the
upstream worker, and call methods on the Output port to send rows to the downstream worker.
Note that the input port uses the Default policy. Consider whether this is appropriate, or should be overwritten, see BufferingMode for further details.
Consider using TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> instead if two input ports are needed. Also see the TransformBase example.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class TransformBase<TDerived, TInput, TOutput> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : TransformBase<TDerived, TInput, TOutput> 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 |
Remarks
Note: This class only has overloads for asynchronous callbacks, since using synchronous ones would require the callback to block a thread when there is no upstream rows or downstream demand available, which is not appropriate.
Constructors
TransformBase(in DownstreamFactory<TInput>, String)
Initializes a new instance of the TransformBase<TDerived, TInput, TOutput>
abstract dataflow worker with one Input and one Output port, which can be
used to create a dataflow transform.
Declaration
protected TransformBase(in DownstreamFactory<TInput> downstreamFactory, string workerName)
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 |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
Input
Gets the input port for receiving rows from an upstream worker.
Declaration
public InputPort<TInput> Input { get; }
Property Value
| Type | Description |
|---|---|
| InputPort<TInput> |
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
| Type | Description |
|---|---|
| OutputPort<TOutput> |