Class ActionSource<TOutput>
A dataflow worker which executes a callback once, which in turn calls methods on one Output port to pass data
to the downstream worker.
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> : ActionWorkerBase<ActionSource<TOutput>>, IDisposeOnFinished where TOutput : class
Type Parameters
| Name | Description |
|---|---|
| TOutput | The type of each |
Constructors
ActionSource(WorkerParent, String, Func<ActionSource<TOutput>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionSource<TOutput> dataflow worker.
It executes an asynchronous callback once that calls Output methods to pass data to the downstream worker.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<ActionSource<TOutput>, 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>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionSource(WorkerParent, String, Func<ActionSource<TOutput>, Task>)
Initializes a new instance of the ActionSource<TOutput> dataflow worker.
It executes an asynchronous callback once that calls Output methods to pass data to the downstream worker.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<ActionSource<TOutput>, 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>, Task> | actionAsync | An asynchronous action that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionSource(WorkerParent, String, Func<Boolean>, Func<ActionSource<TOutput>, Task<OutcomeStatus>>)
Initializes a new instance of the ActionSource<TOutput> dataflow worker.
It executes an asynchronous callback once that calls Output methods to pass data to the downstream worker.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<ActionSource<TOutput>, 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>, Task<OutcomeStatus>> | funcAsync | An asynchronous function that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
ActionSource(WorkerParent, String, Func<Boolean>, Func<ActionSource<TOutput>, Task>)
Initializes a new instance of the ActionSource<TOutput> dataflow worker.
It executes an asynchronous callback once that calls Output methods to pass data to the downstream worker.
Declaration
public ActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<ActionSource<TOutput>, 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>, Task> | actionAsync | An asynchronous action that calls methods on |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentNullException |
|
| InvalidOperationException |
|
Properties
Output
Gets the output port for sending rows to the downstream worker.
Declaration
public OutputPort<TOutput> Output { get; }
Property Value
| Type | Description |
|---|---|
| OutputPort<TOutput> |