Class ActionTwoInputTransformFactory
Factory methods that create an ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> dataflow worker that executes an asynchronous callback once, which in turn consumes data from the upstream workers and sends data to the downstream worker. Both input ports and the output port can have rows of different types.
Input data can be processed row by row via TakeRow() etc., or multiple rows can be processed via TryTakeBuffer(TInput[]) etc.
Note that the two inputs by default provide Full buffering of incoming data, which potentially can consume a large amount of memory. See BufferingMode for further details.
Also see the ActionTransform example, which works in a similar way to these methods.
The LeftInput
port is linked to (if available) the upstream
output or error output port specified by the factory.
Get the factory 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>).
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public static class ActionTwoInputTransformFactory
Remarks
These factory methods only have overloads with asynchronous callbacks, since using synchronous ones would require the function to block a thread when there is no downstream demand, which is not appropriate.
Methods
ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>(in DownstreamFactory<TLeftInput>, String, OutputPortBase<TRightInput>, Func<ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> dataflow worker, that executes an asynchronous function once, which in turn consumes data from the upstream worker and sends data to the downstream worker.
The LeftInput
port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>(this in DownstreamFactory<TLeftInput> downstreamFactory, string workerName, OutputPortBase<TRightInput> rightInputFrom, Func<ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>, Task<OutcomeStatus>> funcAsync)
where TLeftInput : class where TRightInput : class where TOutput : class
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 |
Func<ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that consumes rows from the input ports,
and sends rows to the |
Returns
Type | Description |
---|---|
ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> | The newly created and (optionally) linked worker. |
Type Parameters
Name | Description |
---|---|
TLeftInput | The type of each |
TRightInput | The type of each |
TOutput | The type of the output rows. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>(in DownstreamFactory<TLeftInput>, String, OutputPortBase<TRightInput>, Func<ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>, Task>)
Initializes a new instance of the ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> dataflow worker, that executes an asynchronous action once, which in turn consumes data from the upstream worker and sends data to the downstream worker.
The LeftInput
port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>(this in DownstreamFactory<TLeftInput> downstreamFactory, string workerName, OutputPortBase<TRightInput> rightInputFrom, Func<ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>, Task> actionAsync)
where TLeftInput : class where TRightInput : class where TOutput : class
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 |
Func<ActionTwoInputTransform<TLeftInput, TRightInput, TOutput>, Task> | actionAsync | An asynchronous action that consumes rows from the input ports,
and sends rows to the |
Returns
Type | Description |
---|---|
ActionTwoInputTransform<TLeftInput, TRightInput, TOutput> | The newly created and (optionally) linked worker. |
Type Parameters
Name | Description |
---|---|
TLeftInput | The type of each |
TRightInput | The type of each |
TOutput | The type of the output rows. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|