Class TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput>
An abstract dataflow worker with two input ports 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 LeftInput and RightInput
ports to consume rows from the upstream workers, and call methods on the Output port
to send rows to the downstream worker.
Note that the two inputs by default provide Full buffering of incoming data, which potentially can consume a large amount of memory. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.
Note that all dataflow workers must adhere to the Row Ownership rules.
Consider using TransformBase<TDerived, TInput, TOutput> instead if two input ports are not needed. Also see the TransformBase example.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> where TLeftInput : class where TRightInput : class where TOutput : class
Type Parameters
| Name | Description |
|---|---|
| TDerived | The type of the derived worker. Class definition example:
|
| TLeftInput | The type of each |
| TRightInput | 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
TwoInputTransformBase(in DownstreamFactory<TLeftInput>, String, OutputPortBase<TRightInput>)
Initializes a new instance of the TwoInputTransformBase<TDerived, TLeftInput, TRightInput, TOutput> abstract dataflow worker. It executes an asynchronous action once, which consumes data from two upstream workers and sends data to one downstream worker.
Declaration
protected TwoInputTransformBase(in DownstreamFactory<TLeftInput> downstreamFactory, string workerName, OutputPortBase<TRightInput> rightInputFrom)
Parameters
| Type | Name | Description |
|---|---|---|
| DownstreamFactory<TLeftInput> | downstreamFactory | The downstream factory, which specifies the parent worker and (optionally) the upstream port
to link the "first" 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 |
| OutputPortBase<TRightInput> | rightInputFrom | The upstream output port to link the |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
LeftInput
Gets the left input port for consuming rows from the left upstream worker.
Declaration
public InputPort<TLeftInput> LeftInput { get; }
Property Value
| Type | Description |
|---|---|
| InputPort<TLeftInput> | The left input port. |
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
| Type | Description |
|---|---|
| OutputPort<TOutput> | The output port. |
RightInput
Gets the right input port for consuming rows from the right upstream worker.
Declaration
public InputPort<TRightInput> RightInput { get; }
Property Value
| Type | Description |
|---|---|
| InputPort<TRightInput> | The right input port. |