Search Results for

    Show / Hide Table of Contents

    Class OutputPort<TOutput>

    Generic class for dataflow (non-error) output ports. Create these ports with Create<TOutput>(String), or use a dataflow worker that already has the appropriate port(s) added.

    Note: As per normal, unless otherwise noted, the instance members are not thread-safe, and should only be used from the worker that the port belongs to.

    Inheritance
    Object
    OutputPortBase
    OutputPortBase<TOutput>
    OutputPort<TOutput>
    Inherited Members
    OutputPortBase<TOutput>.ClearRowErrors
    OutputPortBase<TOutput>.Link
    OutputPortBase<TOutput>.LinkedTo
    OutputPortBase<TOutput>.LinkTo(InputPort<TOutput>)
    OutputPortBase<TOutput>.SetDebugCommands(DebugPortCommands, Int64)
    OutputPortBase<TOutput>.SetDebugCommands(DebugPortCommands)
    OutputPortBase.BufferCapacity
    OutputPortBase.IsErrorOutput
    OutputPortBase.IsLinked
    OutputPortBase.Locator
    OutputPortBase.Logger
    OutputPortBase.Name
    OutputPortBase.RowsSent
    OutputPortBase.SendError(String, Exception, String, String[])
    OutputPortBase.SendError(String, String, String[])
    OutputPortBase.SendError(String, Exception)
    OutputPortBase.SendError(String)
    OutputPortBase.SendSucceeded()
    OutputPortBase.State
    OutputPortBase.ToLongString()
    OutputPortBase.ToString()
    OutputPortBase.Worker
    OutputPortBase.DebugCommands
    OutputPortBase.DebugBreakAfterRows
    OutputPortBase.ActiveDuration
    OutputPortBase.InstantActive
    OutputPortBase.InstantCompleted
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public sealed class OutputPort<TOutput> : OutputPortBase<TOutput> where TOutput : class
    Type Parameters
    Name Description
    TOutput

    The type of the output rows.

    Properties

    HasBufferDemand

    Returns true if the port State is Active (or can be automatically set to Active from the Ready state), and there is at least BufferCapacity demand for additional rows; otherwise false.

    Declaration
    public bool HasBufferDemand { get; }
    Property Value
    Type Description
    Boolean

    HasRowDemand

    Returns true if there is demand for at least one additional row (irrespective of port state), otherwise false.

    Declaration
    public bool HasRowDemand { get; }
    Property Value
    Type Description
    Boolean

    Methods

    HasBufferDemandAsync()

    Waits asynchronously until there is demand for at least BufferCapacity rows, or the port State is Canceled or completed.

    Declaration
    public Task<bool> HasBufferDemandAsync()
    Returns
    Type Description
    Task<Boolean>

    Task<bool> that will complete when either BufferCapacity demand is present, or State is Canceled or completed.

    Task.Result will be:

    trueIf the port is ready to accept at least BufferCapacity rows
    falseIf the port will never accept more rows due to State being Canceled or completed

    SendBuffer(TOutput[])

    Sends the (no more than BufferCapacity) rows in the whole array to the downstream worker.

    The caller must ensure there is sufficient row demand before calling this method.

    Declaration
    public void SendBuffer(TOutput[] array)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentOutOfRangeException

    Row count larger than BufferCapacity

    InvalidOperationException
    • Row was null
    • Insufficient output port row demand, or port canceled

    SendBuffer(TOutput[], Int32)

    Sends the (no more than BufferCapacity) rows in a section of an array to the downstream worker, starting at index 0.

    The caller must ensure there is sufficient row demand before calling this method.

    Declaration
    public void SendBuffer(TOutput[] array, int count)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Int32 count

    The number of rows to send, at most BufferCapacity. If 0 or negative, no rows will be sent.

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentException

    count indexed a row outside the array

    ArgumentOutOfRangeException

    Row count larger than BufferCapacity

    InvalidOperationException
    • Row was null
    • Insufficient output port row demand, or port canceled

    SendBuffer(TOutput[], Int32, Int32)

    Sends the (no more than BufferCapacity) rows in a section of an array to the downstream worker.

    The caller must ensure there is sufficient row demand before calling this method.

    Declaration
    public void SendBuffer(TOutput[] array, int start, int count)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Int32 start

    The start index.

    Int32 count

    The number of rows to send, at most BufferCapacity. If 0 or negative, no rows will be sent.

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentException

    start and count indexed a row outside the array

    ArgumentOutOfRangeException

    Row count larger than BufferCapacity

    InvalidOperationException
    • Row was null
    • Insufficient output port row demand, or port canceled

    SendRow(TOutput)

    Sends a row to the downstream worker.

    The caller must ensure there is sufficient row demand before calling this method.

    Declaration
    public void SendRow(TOutput row)
    Parameters
    Type Name Description
    TOutput row

    The row.

    Exceptions
    Type Condition
    InvalidOperationException
    • Insufficient output port row demand, attempting to send 1 row.
    • Row was null.

    SendRowAsync(TOutput)

    Sends a row asynchronously to the downstream worker.

    Note that this method does not require checking for sufficient row demand before calling it.

    Declaration
    public Task<bool> SendRowAsync(TOutput row)
    Parameters
    Type Name Description
    TOutput row

    The row.

    Returns
    Type Description
    Task<Boolean>

    true if the row could be sent; otherwise false, in which case the port is canceled or completed.

    Exceptions
    Type Condition
    InvalidOperationException

    Row was null.

    SendRowsAsync(TOutput[])

    Sends all the rows of an array to the downstream worker.

    Note that this method does not require checking for sufficient rows demand before calling it, and it supports sending an arbitrary number of rows (including more than BufferCapacity).

    Declaration
    public Task<bool> SendRowsAsync(TOutput[] array)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Returns
    Type Description
    Task<Boolean>

    A Task{bool} that completes with true when all the specified rows in the array have been successfully sent, or false if all rows could not be sent (in which case the port is either canceled or completed with failure.

    Exceptions
    Type Condition
    ArgumentNullException

    array

    InvalidOperationException

    Row was null

    SendRowsAsync(TOutput[], Int32)

    Sends the rows in a section of an array to the downstream worker, starting from index 0.

    Note that this method does not require checking for sufficient rows demand before calling it, and it supports sending an arbitrary number of rows (including more than BufferCapacity).

    Declaration
    public Task<bool> SendRowsAsync(TOutput[] array, int count)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Int32 count

    The number of rows to send. If 0 or negative, no rows will be sent.

    Returns
    Type Description
    Task<Boolean>

    A Task{bool} that completes with true when all the specified rows in the array have been successfully sent, or false if all rows could not be sent (in which case the port is either canceled or completed with failure.

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentException

    count indexed a row outside the array

    InvalidOperationException

    Row was null

    SendRowsAsync(TOutput[], Int32, Int32)

    Sends the rows in a section of an array to the downstream worker.

    Note that this method does not require checking for sufficient rows demand before calling it, and it supports sending an arbitrary number of rows (including more than BufferCapacity).

    Declaration
    public Task<bool> SendRowsAsync(TOutput[] array, int start, int count)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Int32 start

    The start index.

    Int32 count

    The number of rows to send. If 0 or negative, no rows will be sent.

    Returns
    Type Description
    Task<Boolean>

    A Task{bool} that completes with true when all the specified rows in the array have been successfully sent, or false if all rows could not be sent (in which case the port is either canceled or completed with failure.

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentException

    start and count indexed a row outside the array

    InvalidOperationException

    Row was null

    SendRowsAsync(IEnumerable<TOutput>)

    Sends all the rows in the enumerable to the downstream worker.

    Note that this method does not require checking for sufficient rows demand before calling it, and it supports sending an arbitrary number of rows (including more than BufferCapacity).

    Declaration
    public Task<bool> SendRowsAsync(IEnumerable<TOutput> enumerableRows)
    Parameters
    Type Name Description
    IEnumerable<TOutput> enumerableRows

    The enumerable. Note that it is inherently synchronous, and will block a thread (i.e. consume extra memory etc.) if it cannot supply rows as quickly as the downstream worker consumes them.

    Returns
    Type Description
    Task<Boolean>

    A Task{bool} that completes with true when all the rows in the enumerable have been successfully sent, or false if all rows could not be sent (in which case the port is either canceled or completed with failure.

    Exceptions
    Type Condition
    ArgumentNullException

    enumerableRows

    InvalidOperationException

    Row was null

    TrySendBuffer(TOutput[])

    Try sending all (at most BufferCapacity) rows in the array to the downstream worker.

    Note that this method does not wait for row demand to become available.

    Declaration
    public bool TrySendBuffer(TOutput[] array)
    Parameters
    Type Name Description
    TOutput[] array

    The array, with at most BufferCapacity rows.

    Returns
    Type Description
    Boolean

    true if the rows could sent, otherwise false, in which case no rows would have been sent, and they would need to be sent some other way, typically with SendRowsAsync(TOutput[]).

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentOutOfRangeException

    Row count larger than BufferCapacity

    InvalidOperationException

    Row was null.

    TrySendBuffer(TOutput[], Int32)

    Try sending (at most BufferCapacity) rows to the downstream worker, starting from index 0 in the array.

    Note that this method does not wait for row demand to become available.

    Declaration
    public bool TrySendBuffer(TOutput[] array, int count)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Int32 count

    The number of rows to send, at most BufferCapacity. If 0 or negative, no rows will be sent.

    Returns
    Type Description
    Boolean

    true if the rows could sent, otherwise false, in which case no rows would have been sent, and they would need to be sent some other way, typically with SendRowsAsync(TOutput[], Int32).

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentException

    count indexed a row outside the array

    ArgumentOutOfRangeException

    Row count larger than BufferCapacity

    InvalidOperationException

    Row was null.

    TrySendBuffer(TOutput[], Int32, Int32)

    Try sending (at most BufferCapacity) rows to the downstream worker.

    Note that this method does not wait for row demand to become available.

    Declaration
    public bool TrySendBuffer(TOutput[] array, int start, int count)
    Parameters
    Type Name Description
    TOutput[] array

    The array.

    Int32 start

    The start index.

    Int32 count

    The number of rows to send, at most BufferCapacity. If 0 or negative, no rows will be sent.

    Returns
    Type Description
    Boolean

    true if the rows could sent, otherwise false, in which case no rows would have been sent, and they would need to be sent some other way, typically with SendRowsAsync(TOutput[], Int32, Int32).

    Exceptions
    Type Condition
    ArgumentNullException

    array

    ArgumentException

    start and count indexed a row outside the array

    ArgumentOutOfRangeException

    Row count larger than BufferCapacity

    InvalidOperationException

    Row was null.

    TrySendRow(TOutput)

    Sends a row to the downstream worker if there is any row demand.

    Declaration
    public bool TrySendRow(TOutput row)
    Parameters
    Type Name Description
    TOutput row

    The row.

    Returns
    Type Description
    Boolean

    true if the row could be sent; otherwise false, in which case the row must be sent some other way, typically with SendRowAsync(TOutput).

    Exceptions
    Type Condition
    InvalidOperationException

    Row was null.

    See Also

    OutputPortBase
    OutputPortBase<TOutput>
    ErrorOutputPort<TError>
    OutputPortBaseState
    OutputPortCollection
    InputPort<TInput>
    In This Article
    Back to top Copyright © 2021 Envobi Ltd