Search Results for

    Show / Hide Table of Contents

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

    The type of each Output row.

    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 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<ActionSource<TOutput>, Task<OutcomeStatus>> funcAsync

    An asynchronous function that calls methods on Output to pass data to the downstream worker.

    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?

    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 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<ActionSource<TOutput>, Task> actionAsync

    An asynchronous action that calls methods on Output to pass data to the downstream worker.

    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?

    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 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<ActionSource<TOutput>, Task<OutcomeStatus>> funcAsync

    An asynchronous function that calls methods on Output to pass data to the downstream worker.

    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?

    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 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<ActionSource<TOutput>, Task> actionAsync

    An asynchronous action that calls methods on Output to pass data to the downstream worker.

    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

    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