Class Worker
A worker which only has the intrinsic functionality inherited from WorkerBase<TDerived>, such as Start constraints and Grouping children.
If it runs, this worker will always complete with a Succeeded status. Use ActionWorker instead to complete with a failure or calculated status.
Common use cases:
Start constraints | Useful for concentrating multiple start constraints in one worker, e.g. to mark the end of one stage in the processing. Later stages can then reference this worker in their start constraints. |
Grouping children | Used when adding children to a worker from either another worker, or from outside the worker system (typically before starting the worker system). |
This class is sealed. WorkerBase is available to derive from.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public sealed class Worker : WorkerBase<Worker>, IDisposeOnFinished
Constructors
Worker(WorkerParent, String)
Initializes a new instance of Worker.
Declaration
public Worker(WorkerParent workerParent, string workerName)
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 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
Worker(WorkerParent, String, Func<Boolean>)
Initializes a new instance of Worker.
Declaration
public Worker(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc)
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 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
Methods
RunAsync()
For internal use.
Declaration
protected override Task<OutcomeStatus> RunAsync()
Returns
Type | Description |
---|---|
Task<OutcomeStatus> |