Class ActionTransformFactory
Factory methods that create an ActionTransform<TInputOutputError> or ActionTransform<TInputError, TOutput> dataflow worker that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker.
Input data can be processed row by row via TakeRow() etc., or multiple rows can be processed via TryTakeBuffer(TInput[]) etc.
The input port uses the Default policy. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.
Also see the ActionTransform example.
The Input
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 ActionTransformFactory
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
ActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<ActionTransform<TInputOutputError>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionTransform<TInputOutputError> dataflow worker, that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker. Input, output, and error output rows have the same type.
The Input
port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static ActionTransform<TInputOutputError> ActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<ActionTransform<TInputOutputError>, Task<OutcomeStatus>> funcAsync)
where TInputOutputError : class
Parameters
Type | Name | Description |
---|---|---|
DownstreamFactory<TInputOutputError> | 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 |
Func<ActionTransform<TInputOutputError>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that consumes rows from the |
Returns
Type | Description |
---|---|
ActionTransform<TInputOutputError> | The newly created and (optionally) linked worker. |
Type Parameters
Name | Description |
---|---|
TInputOutputError | The type of the input, output, and error output rows. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
ActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<ActionTransform<TInputOutputError>, Task>)
Initializes a new instance of the ActionTransform<TInputOutputError> dataflow worker, that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker. Input, output, and error output rows have the same type.
The Input
port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static ActionTransform<TInputOutputError> ActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<ActionTransform<TInputOutputError>, Task> actionAsync)
where TInputOutputError : class
Parameters
Type | Name | Description |
---|---|---|
DownstreamFactory<TInputOutputError> | 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 |
Func<ActionTransform<TInputOutputError>, Task> | actionAsync | An asynchronous action that consumes rows from the |
Returns
Type | Description |
---|---|
ActionTransform<TInputOutputError> | The newly created and (optionally) linked worker. |
Type Parameters
Name | Description |
---|---|
TInputOutputError | The type of the input, output, and error output rows. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
ActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<ActionTransform<TInputError, TOutput>, Task<OutcomeStatus>>)
Initializes a new instance of the
ActionTransform<TInputError, TOutput>
dataflow worker, that executes an asynchronous callback once, which in turn consumes data
from the upstream worker and sends data to the downstream worker.
Input and error output rows have the same type, but output rows have a different type (instead use
ActionTransform1
overloads if input and output rows are of the same type).
The Input
port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static ActionTransform<TInputError, TOutput> ActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<ActionTransform<TInputError, TOutput>, Task<OutcomeStatus>> funcAsync)
where TInputError : class where TOutput : class
Parameters
Type | Name | Description |
---|---|---|
DownstreamFactory<TInputError> | 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 |
Func<ActionTransform<TInputError, TOutput>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that consumes rows from the |
Returns
Type | Description |
---|---|
ActionTransform<TInputError, TOutput> | The newly created and (optionally) linked worker. |
Type Parameters
Name | Description |
---|---|
TInputError | The type of input as well as error output rows. |
TOutput | The type of output rows. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
ActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<ActionTransform<TInputError, TOutput>, Task>)
Initializes a new instance of the
ActionTransform<TInputError, TOutput>
dataflow worker, that executes an asynchronous callback once, which in turn consumes data
from the upstream worker and sends data to the downstream worker.
Input and error output rows have the same type, but output rows have a different type (instead use
ActionTransform1
overloads if input and output rows are of the same type).
The Input
port is linked to (if available) the upstream
output or error output port specified by the factory.
Declaration
public static ActionTransform<TInputError, TOutput> ActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<ActionTransform<TInputError, TOutput>, Task> actionAsync)
where TInputError : class where TOutput : class
Parameters
Type | Name | Description |
---|---|---|
DownstreamFactory<TInputError> | 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 |
Func<ActionTransform<TInputError, TOutput>, Task> | actionAsync | An asynchronous action that consumes rows from the |
Returns
Type | Description |
---|---|
ActionTransform<TInputError, TOutput> | The newly created and (optionally) linked worker. |
Type Parameters
Name | Description |
---|---|
TInputError | The type of input as well as error output rows. |
TOutput | The type of output rows. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|