transferum
    Preparing search index...

    Class SinkTransfer<T>

    Terminal destination (sink) — calls a callback on receiving data.

    Capabilities: isInput, isPushable

    Mechanics:

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

    Error handling:

    • If callback() throws an exception, onError is called.
    • With onError provided, the exception is suppressed. Without onError — rethrown.

    Configuration (SinkTransferConfig):

    • callback: DataHandler — incoming data handler
    • onError?: ErrorHandler — error handler
    • initialValue?: T — initial value (unused)

    Difference from CallbackTransfer (old version):

    • The new version inherits from BaseStateTransfer (has _state)
    • But _state is not used in push() — data goes directly to callback
    • Does not implement isOutput (input only)

    Use cases:

    • Logging: writing data to console/file
    • Side effects: sending metrics, analytics
    • Finalization: saving the result to storage

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

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