Search Results for

    Show / Hide Table of Contents

    Class ActionTransformFactory

    Factory methods that create an ActionTransform<TInputOutputError> or ActionTransform<TInputError, TOutput> dataflow worker that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker.

    Input data can be processed row by row via TakeRow() etc., or multiple rows can be processed via TryTakeBuffer(TInput[]) etc.

    The input port uses the Default policy. Consider whether this is appropriate, or should be overridden, see BufferingMode for further details.

    Also see the ActionTransform example.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Get the factory from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    Inheritance
    Object
    ActionTransformFactory
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public static class ActionTransformFactory
    Remarks

    These factory methods only have overloads with asynchronous callbacks, since using synchronous ones would require the function to block a thread when there is no downstream demand, which is not appropriate.

    Methods

    ActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<ActionTransform<TInputOutputError>, Task<OutcomeStatus>>)

    Initializes a new instance of the ActionTransform<TInputOutputError> dataflow worker, that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker. Input, output, and error output rows have the same type.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static ActionTransform<TInputOutputError> ActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<ActionTransform<TInputOutputError>, Task<OutcomeStatus>> funcAsync)
        where TInputOutputError : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    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<ActionTransform<TInputOutputError>, Task<OutcomeStatus>> funcAsync

    An asynchronous function that consumes rows from the Input port, and sends rows to the Output port.

    Returns
    Type Description
    ActionTransform<TInputOutputError>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutputError

    The type of the input, output, and error output rows.

    Exceptions
    Type Condition
    ArgumentNullException

    funcAsync

    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?

    ActionTransform1<TInputOutputError>(in DownstreamFactory<TInputOutputError>, String, Func<ActionTransform<TInputOutputError>, Task>)

    Initializes a new instance of the ActionTransform<TInputOutputError> dataflow worker, that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker. Input, output, and error output rows have the same type.

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static ActionTransform<TInputOutputError> ActionTransform1<TInputOutputError>(this in DownstreamFactory<TInputOutputError> downstreamFactory, string workerName, Func<ActionTransform<TInputOutputError>, Task> actionAsync)
        where TInputOutputError : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputOutputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

    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<ActionTransform<TInputOutputError>, Task> actionAsync

    An asynchronous action that consumes rows from the Input port, and sends rows to the Output port.

    Returns
    Type Description
    ActionTransform<TInputOutputError>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputOutputError

    The type of the input, output, and error output rows.

    Exceptions
    Type Condition
    ArgumentNullException

    actionAsync

    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?

    ActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<ActionTransform<TInputError, TOutput>, Task<OutcomeStatus>>)

    Initializes a new instance of the ActionTransform<TInputError, TOutput> dataflow worker, that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker. Input and error output rows have the same type, but output rows have a different type (instead use ActionTransform1 overloads if input and output rows are of the same type).

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static ActionTransform<TInputError, TOutput> ActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<ActionTransform<TInputError, TOutput>, Task<OutcomeStatus>> funcAsync)
        where TInputError : class where TOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

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

    An asynchronous function that consumes rows from the Input port, and sends rows to the Output port.

    Returns
    Type Description
    ActionTransform<TInputError, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputError

    The type of input as well as error output rows.

    TOutput

    The type of output rows.

    Exceptions
    Type Condition
    ArgumentNullException

    funcAsync

    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?

    ActionTransform2<TInputError, TOutput>(in DownstreamFactory<TInputError>, String, Func<ActionTransform<TInputError, TOutput>, Task>)

    Initializes a new instance of the ActionTransform<TInputError, TOutput> dataflow worker, that executes an asynchronous callback once, which in turn consumes data from the upstream worker and sends data to the downstream worker. Input and error output rows have the same type, but output rows have a different type (instead use ActionTransform1 overloads if input and output rows are of the same type).

    The Input port is linked to (if available) the upstream output or error output port specified by the factory.

    Declaration
    public static ActionTransform<TInputError, TOutput> ActionTransform2<TInputError, TOutput>(this in DownstreamFactory<TInputError> downstreamFactory, string workerName, Func<ActionTransform<TInputError, TOutput>, Task> actionAsync)
        where TInputError : class where TOutput : class
    Parameters
    Type Name Description
    DownstreamFactory<TInputError> downstreamFactory

    The downstream factory, which specifies the parent worker and (optionally) the upstream port to link the "first" input port of this dataflow worker to.

    Get it from Link when the upstream port is known ahead of time (which is usually the case). Otherwise get it from GetDownstreamFactory<TInput>(), and link the transform or target explicitly using LinkTo(InputPort<TOutput>) or LinkFrom(OutputPortBase<TInput>).

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

    An asynchronous action that consumes rows from the Input port, and sends rows to the Output port.

    Returns
    Type Description
    ActionTransform<TInputError, TOutput>

    The newly created and (optionally) linked worker.

    Type Parameters
    Name Description
    TInputError

    The type of input as well as error output rows.

    TOutput

    The type of output rows.

    Exceptions
    Type Condition
    ArgumentNullException

    actionAsync

    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?

    See Also

    ActionTransform<TInputOutputError>
    ActionTransform<TInputError, TOutput>
    In This Article
    Back to top Copyright © 2023 Envobi Ltd