Class TargetBase<TDerived, TInput>
An abstract dataflow worker with one Input
port, which can be used to create a dataflow target.
When starting a worker, the library calls RunAsync() during the worker
Running phase. A derived class must override
this abstract method, and call methods on the Input
port to consume data rows
from the upstream worker.
Note that the worker Running
phase also includes additional places where logic can
optionally be inserted via callbacks, to e.g. customize the initialization, cleanup,
and error handling of existing workers. This is mostly used when customizing workers that
are not designed to be derived from (i.e. without a "Base" suffix).
See
Worker Life-cycle for details.
Use TargetBase<TDerived, TInput, TError> instead if an ErrorOutput
port is needed.
Also see the
TargetBase
example.
Note: The input port uses the Default policy. Consider whether this is appropriate, or should be changed, see BufferingMode for further details.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class TargetBase<TDerived, TInput> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : TargetBase<TDerived, TInput> where TInput : class
Type Parameters
Name | Description |
---|---|
TDerived | The type of the derived worker. Class definition example:
|
TInput | The type of each |
Constructors
TargetBase(in DownstreamFactory<TInput>, String)
Initializes a new instance of the TargetBase<TDerived, TInput>
dataflow worker with one Input
port.
Declaration
protected TargetBase(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> |