Interface DataLoadingOptions

interface DataLoadingOptions {
    maxBars?: number;
    maxEmptyPages?: number;
    now?: () => number;
    pageSize?: number;
    pageWindowSec?: number;
    pollIntervalMs?: number;
    refreshOnBarClose?:
        | boolean
        | { delayMs?: number; retries?: number; retryDelayMs?: number };
    refreshOnGap?: boolean;
    refreshWindowBars?: number;
    requestPool?: HistoryRequestPool;
    timeoutMs?: number;
}

Properties

maxBars?: number
maxEmptyPages?: number

Empty windows inspected per gesture, without claiming permanent exhaustion.

now?: () => number

UTC seconds.

pageSize?: number
pageWindowSec?: number

Date-window fallback for feeds without getBarsPage. Defaults to the load window.

pollIntervalMs?: number

Optional history repair cadence. Zero disables polling.

refreshOnBarClose?:
    | boolean
    | { delayMs?: number; retries?: number; retryDelayMs?: number }

Repair the tail when a bar closes, driven by the stream rather than the clock. A pushed bar that opens a new bucket means the bar before it has just closed, so one refresh runs delayMs later (default 2500 ms), long enough for a broker's history to have published the close. Nothing fires while the stream is quiet, so a closed market costs no requests. When the reply still stops short of the bar that closed, the repair retries retries times (default 2), retryDelayMs apart (default 5000 ms). Off by default.

refreshOnGap?: boolean

Refresh at once when a pushed bar skips one or more whole buckets, which is what a stream leaves behind after a dropped socket, a hidden tab or a sleeping machine. Needs a fixed-length interval. Off by default.

refreshWindowBars?: number

How many bars back from the tail a refresh re-fetches. Unset re-fetches the whole load window on every refresh, which is what polling always did; a small number turns each repair into a tail request. A gap repair widens the window to cover the gap. Needs a fixed-length interval; any other interval keeps the whole window.

requestPool?: HistoryRequestPool
timeoutMs?: number