TomTom Maps for JavaScript
    Preparing search index...

    Type Alias RetryConfig

    How the SDK retries rate-limited (429) responses.

    When a service request receives a 429 status code, the SDK retries it with exponential backoff. It respects a Retry-After header given in seconds.

    Without a Retry-After header, each wait is drawn at random between half the backoff and the whole of it, so that clients rate-limited at the same moment don't all retry together.

    TomTomConfig.instance.put({
    retry: {
    initialWaitMs: 447,
    backoffFactor: 1.618,
    timeoutMs: 40000,
    }
    });
    type RetryConfig = {
        backoffFactor?: number;
        initialWaitMs?: number;
        timeoutMs?: number;
    }
    Index
    backoffFactor?: number

    The multiplier applied to the backoff after each retry.

    For example, with initialWaitMs: 447 and backoffFactor: 1.618, the backoff is 447ms, 723ms, 1170ms and so on.

    1.618
    
    initialWaitMs?: number

    The backoff in milliseconds before the first retry: the longest the first wait can be.

    It applies when no Retry-After header is present.

    447
    
    timeoutMs?: number

    The maximum total time in milliseconds to spend retrying.

    If the next wait would exceed this timeout, measured from the first request, the SDK returns the 429 error to the caller.

    40000