Class ActionTargetFactory
Factory methods that create an
ActionTarget<TInput> or
ActionTarget<TInput, TError>
dataflow worker, which runs an asynchronous callback once, which in turn calls
methods on the Input port to consume rows from the upstream worker.
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>).
Also see the ActionTarget example.
Note: This class only has overloads for asynchronous callbacks, since using synchronous ones would require the callback to block a thread when there are no upstream rows available, which is not appropriate.
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public static class ActionTargetFactory
Methods
ActionTarget<TInput>(in DownstreamFactory<TInput>, String, Func<ActionTarget<TInput>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionTarget<TInput>
dataflow worker, which executes an asynchronous callback once, which in turn calls
methods on the Input port to consume rows from the upstream worker.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
The target does not have any ErrorOutput port.
Also see the ActionTarget example.
Note: The input port uses the Default policy. Consider whether this is appropriate, or should be changed, see BufferingMode for further details.
Declaration
public static ActionTarget<TInput> ActionTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<ActionTarget<TInput>, Task<OutcomeStatus>> funcAsync)
where TInput : class
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 |
| Func<ActionTarget<TInput>, Task<OutcomeStatus>> | funcAsync | The asynchronous function to execute. Return an failure
|
Returns
| Type | Description |
|---|---|
| ActionTarget<TInput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionTarget<TInput>(in DownstreamFactory<TInput>, String, Func<ActionTarget<TInput>, Task>)
Initializes a new instance of the ActionTarget<TInput>
dataflow worker, which executes an asynchronous callback once, which in turn calls
methods on the Input port to consume rows from the upstream worker.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
The target does not have any ErrorOutput port.
Also see the ActionTarget example.
Note: The input port uses the Default policy. Consider whether this is appropriate, or should be changed, see BufferingMode for further details.
Declaration
public static ActionTarget<TInput> ActionTarget<TInput>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<ActionTarget<TInput>, Task> actionAsync)
where TInput : class
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 |
| Func<ActionTarget<TInput>, Task> | actionAsync | The asynchronous action to execute. |
Returns
| Type | Description |
|---|---|
| ActionTarget<TInput> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionTarget<TInput, TError>(in DownstreamFactory<TInput>, String, Func<ActionTarget<TInput, TError>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionTarget<TInput, TError>
dataflow worker, which executes an asynchronous callback once, which in turn calls
methods on the Input port to consume rows from the upstream worker.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Note that the target has an ErrorOutput port, and the port type parameters must
be specified, e.g.:
.Output.Link.ActionTarget<SmallClass,SmallClass>(
"target"
, async rat =>
{
// Consume input, and optionally send to the ErrorOutput port
}
);
Also see the ActionTarget example.
Note: The input port uses the Default policy. Consider whether this is appropriate, or should be changed, see BufferingMode for further details.
Declaration
public static ActionTarget<TInput, TError> ActionTarget<TInput, TError>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<ActionTarget<TInput, TError>, Task<OutcomeStatus>> funcAsync)
where TInput : class where TError : class
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 |
| Func<ActionTarget<TInput, TError>, Task<OutcomeStatus>> | funcAsync | The asynchronous function to execute. Return an failure
|
Returns
| Type | Description |
|---|---|
| ActionTarget<TInput, TError> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
| TError | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionTarget<TInput, TError>(in DownstreamFactory<TInput>, String, Func<ActionTarget<TInput, TError>, Task>)
Initializes a new instance of the ActionTarget<TInput, TError>
dataflow worker, which executes an asynchronous callback once, which in turn calls
methods on the Input port to consume rows from the upstream worker.
The Input port is linked to (if available) the upstream
output or error output port specified by the factory.
Note that the target has an ErrorOutput port, and the port type parameters must
be specified, e.g.:
.Output.Link.ActionTarget<SmallClass,SmallClass>(
"target"
, async rat =>
{
// Consume input, and optionally send to the ErrorOutput port
}
);
Also see the ActionTarget example.
Note: The input port uses the Default policy. Consider whether this is appropriate, or should be changed, see BufferingMode for further details.
Declaration
public static ActionTarget<TInput, TError> ActionTarget<TInput, TError>(this in DownstreamFactory<TInput> downstreamFactory, string workerName, Func<ActionTarget<TInput, TError>, Task> actionAsync)
where TInput : class where TError : class
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 |
| Func<ActionTarget<TInput, TError>, Task> | actionAsync | The asynchronous action to execute. |
Returns
| Type | Description |
|---|---|
| ActionTarget<TInput, TError> | The newly created and (optionally) linked worker. |
Type Parameters
| Name | Description |
|---|---|
| TInput | The type of each |
| TError | The type of each |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|