Search Results for

    Show / Hide Table of Contents

    Class RowsActionSource<TOutput>

    A dataflow worker with one output port which repeatedly executes a function when there is RowsPerBuffer demand on the Output port.

    This class allows the developer to write synchronous or asynchronous code as needed, without having to check for output demand (which simplifies the implementation), as long as no more than RowsPerBuffer rows are sent on each invocation.

    Also see the RowsActionSource example.

    The user supplied function calls methods on the Output port to pass data to the downstream worker, until it returns:

    • ProgressStatus.NotCompleted to wait for at least RowsPerBuffer Output demand.
    • ProgressStatus.Succeeded to stop producing rows. If the Output port is not completed, the library will call SendSucceeded() to complete it.
    • ProgressStatus.Error or ProgressStatus.Fatal to fail the worker. If the Output port is not completed, the library will call SendError(String) to complete it.

    Inheritance
    Object
    WorkerParent
    WorkerBase
    WorkerBase<RowsActionSource<TOutput>>
    RowsActionSource<TOutput>
    Implements
    IDisposeOnFinished
    Inherited Members
    WorkerBase<RowsActionSource<TOutput>>.AddCompletedCallback(Func<RowsActionSource<TOutput>, OutcomeStatus, Task<OutcomeStatus>>)
    WorkerBase<RowsActionSource<TOutput>>.AddRanCallback(Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)
    WorkerBase<RowsActionSource<TOutput>>.AddStartingCallback(Func<RowsActionSource<TOutput>, 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.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 class RowsActionSource<TOutput> : WorkerBase<RowsActionSource<TOutput>>, IDisposeOnFinished where TOutput : class
    Type Parameters
    Name Description
    TOutput

    The type of each Output rows.

    Constructors

    RowsActionSource(WorkerParent, String, Func<RowsActionSource<TOutput>, ProgressStatus>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a synchronous outputDemandFunc function when there is RowsPerBuffer demand on the Output port. The Output will be automatically completed, if needed.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc)
    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<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc

    A synchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFunc

    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?

    RowsActionSource(WorkerParent, String, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a asynchronous outputDemandFuncAsync function when there is RowsPerBuffer demand on the Output port. The Output will be automatically completed, if needed.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync)
    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<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync

    An asynchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFuncAsync

    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?

    RowsActionSource(WorkerParent, String, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>, Func<RowsActionSource<TOutput>, ProgressStatus>, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a synchronous outputDemandFunc function when there is RowsPerBuffer demand on the Output port.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync, Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
    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<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc

    A synchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFunc

    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?

    RowsActionSource(WorkerParent, String, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a asynchronous outputDemandFuncAsync function when there is RowsPerBuffer demand on the Output port.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
    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<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync

    An asynchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFuncAsync

    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?

    RowsActionSource(WorkerParent, String, Func<Boolean>, Func<RowsActionSource<TOutput>, ProgressStatus>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a synchronous outputDemandFunc function when there is RowsPerBuffer demand on the Output port. The Output will be automatically completed, if needed.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc)
    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.

    Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc

    A synchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFunc

    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?

    RowsActionSource(WorkerParent, String, Func<Boolean>, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a asynchronous outputDemandFuncAsync function when there is RowsPerBuffer demand on the Output port. The Output will be automatically completed, if needed.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync)
    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.

    Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync

    An asynchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFuncAsync

    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?

    RowsActionSource(WorkerParent, String, Func<Boolean>, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>, Func<RowsActionSource<TOutput>, ProgressStatus>, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a synchronous outputDemandFunc function when there is RowsPerBuffer demand on the Output port.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync, Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
    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.

    Func<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, ProgressStatus> outputDemandFunc

    A synchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFunc

    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?

    RowsActionSource(WorkerParent, String, Func<Boolean>, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>, Func<RowsActionSource<TOutput>, Task<ProgressStatus>>, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>)

    Initializes a new instance of the RowsActionSource<TOutput> dataflow worker which repeatedly executes a asynchronous outputDemandFuncAsync function when there is RowsPerBuffer demand on the Output port.

    Declaration
    public RowsActionSource(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync, Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync, Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync)
    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.

    Func<RowsActionSource<TOutput>, Task<ProgressStatus>> startingFuncAsync

    A function that will be called before the row processing starts, ignored if null. It receives the worker as a parameter, and should return:

    • NotCompleted to perform normal row processing.
    • Succeeded to skip normal by row processing by discarding any input rows, and successfully complete any output ports.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, Task<ProgressStatus>> outputDemandFuncAsync

    An asynchronous function that is called repeatedly when there is RowsPerBuffer demand available from the downstream worker. The function in turn creates new rows and calls methods on the Output port to pass data to the downstream worker, until it has either exhausted the current output demand, or finished sending rows. It must not send more rows than there is demand on the Output port. It receives the worker as a parameter, and should return:

    • NotCompleted to continue row processing.
    • Succeeded to finish row processing.
    • Error or Fatal to fail the worker and any incomplete ports, stopping further row processing.

    Func<RowsActionSource<TOutput>, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>> ranFuncAsync

    A function that will be called after any startingFuncAsync and normal processing have completed. Receives the worker and the current OutcomeStatus as parameters. It should return:

    • Succeeded to complete the worker successfully. Note that if any ports have not been completed, or have failed, then the worker will still be failed.
    • Error or Fatal to fail the worker and any incomplete ports.
    Set to null to return the same OutcomeStatus that was passed in, after (if needed) completing the Output port according to the OutcomeStatus.

    Exceptions
    Type Condition
    ArgumentNullException

    outputDemandFuncAsync

    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

    Output

    Gets the output port for sending rows to the downstream worker.

    Declaration
    public OutputPort<TOutput> Output { get; }
    Property Value
    Type Description
    OutputPort<TOutput>

    Methods

    RunAsync()

    This method can be overridden to add custom functionality to the derived worker that runs before and after the row processing, but after AddStartingCallback(Func<WorkerBase, Task<ProgressStatus>>) and before AddRanCallback(Func<WorkerBase, OutcomeStatus, WorkerParentChildrenState, Task<OutcomeStatus>>). In this case, the base class base.RunAsync() must be called for the worker to function correctly.

    Typically, this worker is used without overriding this method.

    Declaration
    protected override async Task<OutcomeStatus> RunAsync()
    Returns
    Type Description
    Task<OutcomeStatus>

    A Task describing the success or failure of the worker. An asynchronous async implementation would e.g. return OutcomeStatus.Succeeded on success, while a synchronous implementation would return OutcomeStatus.SucceededTask.

    Overrides
    WorkerParent.RunAsync()

    Implements

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