Search Results for

    Show / Hide Table of Contents

    Class SourceBase<TDerived, TOutput, TError>

    An abstract dataflow worker with one Output port and one ErrorOutput 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 and ErrorOutput ports 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> instead if an ErrorOutput port is not needed. Also see the SourceBase example.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<TDerived>
    SourceBase<TDerived, TOutput, TError>
    Implements
    IDisposeOnFinished
    Inherited Members
    WorkerBase<TDerived>.AddCompletedCallback(Func<TDerived, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<TDerived>.AddRanCallback(Func<TDerived, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<TDerived>.AddStartingCallback(Func<TDerived, Task<ProgressStatus>>)
    WorkerBase.AddCompletedCallback(Func<WorkerBase, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase.AddRanCallback(Func<WorkerBase, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase.AddStartingCallback(Func<WorkerBase, Task<ProgressStatus>>)
    WorkerBase.DefaultIsStartable()
    WorkerBase.ErroredPortErrorsWorkerProtected
    WorkerBase.ErrorOutputs
    WorkerBase.EscalateError
    WorkerBase.Inputs
    WorkerBase.IsStartable
    WorkerBase.Outputs
    WorkerBase.Parent
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(WorkerBase, TLastWorker)
    WorkerBase.SucceededSequence<TLastWorker>(TLastWorker)
    WorkerParent.AddChildCompletedCallback(Action<WorkerBase>)
    WorkerParent.AddStartingChildrenCallback(Func<WorkerParent, Task<ProgressStatus>>)
    WorkerParent.BytesPerRowBuffer
    WorkerParent.Children
    WorkerParent.DisposeOnFinished<TDisposable>(TDisposable)
    WorkerParent.GetDownstreamFactory<TInput>()
    WorkerParent.HasChildren
    WorkerParent.IsCanceled
    WorkerParent.IsCompleted
    WorkerParent.IsCreated
    WorkerParent.IsError
    WorkerParent.IsFailed
    WorkerParent.IsFatal
    WorkerParent.IsRunning
    WorkerParent.IsSucceeded
    WorkerParent.KeepChildrenLevels
    WorkerParent.Locator
    WorkerParent.LogFactory
    WorkerParent.Logger
    WorkerParent.MaxRunningChildren
    WorkerParent.Name
    WorkerParent.RemoveChildren()
    WorkerParent.RescheduleChildren()
    WorkerParent.RunAsync()
    WorkerParent.RunChildrenAsync(Boolean)
    WorkerParent.RunChildrenAsync()
    WorkerParent.Status
    WorkerParent.Item[String]
    WorkerParent.ToString()
    WorkerParent.WorkerSystem
    WorkerParent.DebugCommands
    WorkerParent.AggregateErrorOutputRows
    WorkerParent.AggregateOutputRows
    WorkerParent.AggregateWorkersCompleted
    WorkerParent.InstantCompleted
    WorkerParent.InstantCreated
    WorkerParent.InstantStarted
    WorkerParent.RunningDuration
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public abstract class SourceBase<TDerived, TOutput, TError> : WorkerBase<TDerived>, IDisposeOnFinished where TDerived : SourceBase<TDerived, TOutput, TError> where TOutput : class where TError : class
    Type Parameters
    Name Description
    TDerived

    The type of the derived worker. Class definition example:

    public class MySource<TOutput,TError>
        : SourceBase<MySource<TOutput,TError>,TOutput,TError>
        where TOutput : class, new()
        where TError : class
    { 
        // ...
    }
    TOutput

    The type of each Output row.

    TError

    The type of each ErrorOutput row.

    Constructors

    SourceBase(WorkerParent, String, Func<Boolean>)

    Initializes a new instance of the SourceBase<TDerived, TOutput, TError> abstract dataflow worker, with one Output port and one ErrorOutput port. It can be used to create a dataflow source.

    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 null.

    String workerName

    Name of the worker.

    Set to a prefix plus a trailing "/" (e.g. "MyPrefix-/") to generate a unique name from the prefix plus an increasing number starting at 1.

    While less useful, set to null, whitespace or "/" to generate a unique name from the worker type plus an increasing number starting at 1.

    The name cannot otherwise contain "/", and cannot start with double underscore "__".

    Func<Boolean> isStartableFunc

    Function to calculate the worker start constraint; it should return true for startable and false for not startable. Defaults to startable if null.

    Exceptions
    Type Condition
    ArgumentException

    workerName:

    • Workers with the same parent must have unique names.
    • Worker and worker system names cannot contain '/' or start with double underscore '__'.
    ArgumentNullException

    workerParent - All workers must have a parent. The top level workers have the worker system as parent.

    InvalidOperationException
    • Cannot add child worker to parent which has completed. Are you adding it to the correct parent?
    • Cannot add worker to parent, since its children have been started. Are you adding it to the correct parent?

    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>

    Implements

    IDisposeOnFinished
    In This Article
    Back to top Copyright © 2023 Envobi Ltd