@playlive/tiltify-search
    Preparing search index...

    Interface ResilientHttpClientOptions

    Tunables for createResilientHttpClient. All optional.

    interface ResilientHttpClientOptions {
        baseBackoffMs?: number;
        fetchImpl?: (
            input: RequestInfo | URL,
            init?: RequestInit,
        ) => Promise<Response>;
        jitterMs?: number;
        maxRetries?: number;
        onRetry?: (info: RetryInfo) => void;
        sleepImpl?: (ms: number) => Promise<void>;
    }
    Index
    baseBackoffMs?: number

    Base backoff (ms) used when the response has no Retry-After header. Doubles each attempt and adds random jitter up to ResilientHttpClientOptions.jitterMs. Defaults to 500.

    fetchImpl?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

    Injected fetch for tests. Defaults to the global fetch. Typed as the minimum signature the client actually calls so that simple test mocks (which don't implement preconnect) satisfy the contract.

    jitterMs?: number

    Random jitter (ms) added on top of the exponential backoff. Helps avoid synchronized retries from concurrent in-flight calls hammering the same throttled endpoint. Defaults to 250.

    maxRetries?: number

    Maximum number of additional attempts after the initial request. The total attempt count is maxRetries + 1. Defaults to 3 (i.e. up to 4 attempts).

    onRetry?: (info: RetryInfo) => void

    Optional hook fired before each backoff sleep. Receives the status, URL, body sample, and the chosen sleep duration. Use it to emit a structured log line — the resilient client itself is silent.

    sleepImpl?: (ms: number) => Promise<void>

    Injected sleep function for tests. Defaults to setTimeout-based sleep. Receives milliseconds.