Class ActionSource<TOutput, TError>
A dataflow worker which executes a callback once that calls methods on one Output port
and one ErrorOutput port to pass data to downstream workers.
Also see the ActionSource example.
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 downstream demand, which is not appropriate.
Inheritance
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public class ActionSource<TOutput, TError> : ActionWorkerBase<ActionSource<TOutput, TError>>, IDisposeOnFinished where TOutput : class where TError : class
Type Parameters
| Name | Description |
|---|---|
| TOutput | The type of each |
| TError | The type of each |
Constructors
ActionSource(WorkerParent, String, Func<ActionSource<TOutput, TError>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionSource<TOutput, TError> dataflow worker.
It executes an asynchronous callback once that calls Output and ErrorOutput methods
to pass data to downstream workers.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<ActionSource<TOutput, TError>, Task<OutcomeStatus>> funcAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<ActionSource<TOutput, TError>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionSource(WorkerParent, String, Func<ActionSource<TOutput, TError>, Task>)
Initializes a new instance of the ActionSource<TOutput, TError> dataflow worker.
It executes an asynchronous callback once that calls Output and ErrorOutput methods
to pass data to downstream workers.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<ActionSource<TOutput, TError>, Task> actionAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<ActionSource<TOutput, TError>, Task> | actionAsync | An asynchronous action that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionSource(WorkerParent, String, Func<Boolean>, Func<ActionSource<TOutput, TError>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionSource<TOutput, TError> dataflow worker.
It executes an asynchronous callback once that calls Output and ErrorOutput methods
to pass data to downstream workers.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<ActionSource<TOutput, TError>, Task<OutcomeStatus>> funcAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
| Func<ActionSource<TOutput, TError>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionSource(WorkerParent, String, Func<Boolean>, Func<ActionSource<TOutput, TError>, Task>)
Initializes a new instance of the ActionSource<TOutput, TError> dataflow worker.
It executes an asynchronous callback once that calls Output and ErrorOutput methods
to pass data to downstream workers.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<ActionSource<TOutput, TError>, Task> actionAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
| String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
| Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
| Func<ActionSource<TOutput, TError>, Task> | actionAsync | An asynchronous action that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
ErrorOutput
Gets the error output port for sending error rows to logging and an optional downstream worker.
Declaration
public ErrorOutputPort<TError> ErrorOutput { get; }
Property Value
| Type | Description |
|---|---|
| ErrorOutputPort<TError> |
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
| Type | Description |
|---|---|
| OutputPort<TOutput> |