Class SourceBase<TDerived, TOutput>
An abstract dataflow worker with one Output
port, which can be used to create
a dataflow source.
When starting a worker, the library calls RunAsync() during the worker
Running phase. A derived class must override
this abstract method, and call methods on the Output
port to pass data rows
to the downstream worker.
Note that the worker Running
phase also includes additional places where logic can
optionally be inserted via callbacks, to e.g. customize the initialization, cleanup,
and error handling of existing workers. This is mostly used when customizing workers that
are not designed to be derived from (i.e. without a "Base" suffix).
See
Worker Life-cycle for details.
Use SourceBase<TDerived, TOutput, TError> instead if an ErrorOutput
port is needed.
Also see the
SourceBase
example.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public abstract class SourceBase<TDerived, TOutput> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : SourceBase<TDerived, TOutput> where TOutput : class
Type Parameters
Name | Description |
---|---|
TDerived | The type of the derived worker. Class definition example:
|
TOutput | The type of each |
Constructors
SourceBase(WorkerParent, String, Func<Boolean>)
Initializes a new instance of the SourceBase<TDerived, TOutput>
abstract dataflow worker with one Output
port.
Declaration
protected SourceBase(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 |
|
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> |