transferum
    Preparing search index...

    Class ChannelTransfer<T>

    Output channel with external management via setup/destroy callbacks.

    Capabilities: isOutput, isSubscribable

    Mechanics:

    1. The constructor accepts config with callbacks:
      • setup(emit) — called immediately, receives the emit(data) function
      • destroy() — cleanup function (called on transfer destroy)
    2. setup() should call emit(data) to send data to subscribers
    3. subscribe(handler) — subscribes to notifications
    4. destroy() — calls config.destroy(), unsubscribes subscribers

    Error handling:

    • onError — for errors in emit() (when sending data to subscribers)
    • onDestroyError — for errors in destroy()
    • With the corresponding handler provided, the exception is suppressed.
    • Without a handler, the exception is rethrown.
    • setup() errors are always rethrown (no onSetupError — a failed setup means the transfer is unusable, suppressing would create a zombie object).

    Configuration (ChannelTransferConfig):

    • setup: (emit: DataHandler) => void — channel initialization
    • destroy: () => void — channel cleanup
    • onError?: ErrorHandler — emit() error handler
    • onDestroyError?: ErrorHandler — destroy() error handler

    Difference from StoredChannelTransfer:

    • No pull() — only reactive subscription
    • No trigger() — emission only via external emit()
    • _state does not store a value for reading (cleared after sendState)

    Use cases:

    • Integration with external event sources (WebSocket, DOM events)
    • Adapting legacy API to pipeline
    • Custom data sources with their own logic

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

    Index
    _destroy: () => void
    _emit: DataHandler<T>
    _onDestroyError?: ErrorHandler<ChannelTransfer<T>>
    _state: ProxyReference<T>
    isAsyncPollingProxy: boolean = false
    isAsyncPullable: boolean = false
    isAsyncPushable: boolean = false
    isAsyncTriggerable: boolean = false
    isDuplex: boolean = false
    isGate: boolean = false
    isInput: boolean = false
    isOutput: true
    isPollingProxy: boolean = false
    isPollingSource: boolean = false
    isPullable: boolean = false
    isPushable: boolean = false
    isSubscribable: true
    isTriggerable: boolean = false