transferum
    Preparing search index...

    Class AsyncSinkTransfer<T>

    Asynchronous terminal sink — calls a callback on receiving data.

    Capabilities: isInput, isAsyncPushable

    Mechanics:

    1. The constructor accepts config.callback: AsyncDataHandler
    2. asyncPush(data) — calls await callback(data)
    3. destroy() — inherited from BaseStateTransfer, clears _state

    Ordered execution (config.ordered: true):

    • When enabled, callback invocations are executed sequentially in data-arrival order, regardless of their async duration.
    • Uses an internal OrderedExecutor (promise chain).
    • Default: false (unordered, backward-compatible).

    Error handling:

    • If callback() throws an exception, onError is called.
    • With onError provided, the exception is suppressed. Without onError — rethrown.
    • When ordered: true, the executor chain catches errors so that a throwing callback does not block subsequent callbacks. The error is still propagated to the asyncPush caller via the awaited executor promise.

    Configuration (AsyncSinkTransferConfig):

    • callback: AsyncDataHandler — incoming data handler (sync or async)
    • onError?: ErrorHandler — error handler
    • ordered?: boolean — ordered callback execution (default: false)
    • maxConcurrency?, bufferSize?, onBufferOverflow? (BackpressureConfig)

    Use cases:

    • Asynchronous logging to file/database
    • Side effects with async API (fetch, IndexedDB)

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

    Index
    _state: ProxyReference<T>
    isAsyncPollingProxy: boolean = false
    isAsyncPullable: boolean = false
    isAsyncPushable: true
    isAsyncTriggerable: boolean = false
    isDuplex: boolean = false
    isGate: boolean = false
    isInput: true
    isOutput: boolean = false
    isPollingProxy: boolean = false
    isPollingSource: boolean = false
    isPullable: boolean = false
    isPushable: boolean = false
    isSubscribable: boolean = false
    isTriggerable: boolean = false