transferum
    Preparing search index...

    Class IdlePollingTransfer<T>

    Reactive channel with fallback polling on idle incoming data.

    Capabilities: isInput, isOutput, isDuplex, isPushable, isPullable, isSubscribable, isPollingSource, isTriggerable, isGate

    Mechanics:

    1. push(data) — writes the value, notifies subscribers, clears _state, resets the idle timer and stops polling if it was active
    2. If no data arrived via push() for longer than timeout ms — an internal Ticker (via tickerFactory) starts, periodically polling the fetcher at interval
    3. trigger() — manually calls the fetcher and notifies subscribers, restarts the idle timer
    4. pull() — calls the fetcher directly (without writing to state or notifying subscribers)
    5. subscribe(handler) — subscribes to notifications
    6. activate()/deactivate()/toggle() — control idle monitoring
    7. destroy() — stops timers, unsubscribes subscribers, clears state

    Error handling:

    • If fetcher() throws an exception in trigger() or during polling, onError is called.
    • With onError provided, the exception is suppressed (polling continues).
    • Without onError, the exception is rethrown.

    Configuration (IdlePollingTransferConfig):

    • fetcher: DataFetcher — data retrieval function for idle polling
    • timeout: number — idle time (ms) before polling starts
    • interval: number — fetcher polling interval (ms)
    • activated: boolean — initial idle monitoring state
    • initialValue?: T — initial value in _state
    • tickerFactory?: TickerFactory — custom ticker factory (default: RAFTicker.factory)
    • onError?: ErrorHandler — fetcher error handler

    Use cases:

    • Refreshing data from an API when the external source stops sending events
    • Heartbeat / keep-alive mechanism: polling on absence of incoming data
    • Fallback data source when the main stream is idle

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

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