transferum
    Preparing search index...

    Class PollingSourceTransfer<T>

    Output transfer with internal polling of a data source.

    Capabilities: isOutput, isPollingSource, isPullable, isSubscribable, isTriggerable, isGate

    Mechanics:

    1. The constructor accepts config.fetcher: DataFetcher — a function to retrieve data
    2. An internal Ticker (RAFTicker by default) calls trigger() at the specified interval
    3. trigger() — calls fetcher(), writes the result, notifies subscribers
    4. pull() — calls fetcher() directly (without writing to state)
    5. subscribe(handler) — subscribes to periodic updates
    6. activate()/deactivate()/toggle() — control polling
    7. destroy() — stops the ticker, unsubscribes subscribers

    Error handling:

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

    Configuration (PollingSourceTransferConfig):

    • fetcher: DataFetcher — data retrieval function
    • interval: number — polling interval (ms)
    • activated: boolean — initial polling state
    • tickerFactory?: TickerFactory — custom ticker factory (default: RAFTicker.factory)
    • onError?: ErrorHandler — fetcher error handler

    Use cases:

    • Periodic polling of an API or external source
    • Timer emitting the current time
    • Animation at a fixed FPS

    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: true
    isInput: boolean = false
    isOutput: true
    isPollingProxy: boolean = false
    isPollingSource: true
    isPullable: true
    isPushable: boolean = false
    isSubscribable: true
    isTriggerable: true