websocket-ts
    Preparing search index...

    Interface Backoff

    A Backoff produces a series of numbers that are used to determine the delay between connection-retries. Values are expected to be in milliseconds.

    Implementations must not call back into the websocket (e.g. close() or reconnect()): the websocket calls them in the middle of its lifecycle transitions.

    interface Backoff {
        current: number;
        retries: number;
        next(): number;
        reset(): void;
    }

    Implemented by

    Index
    current: number

    Current number in the series, i.e. the value that the next call to next() will return.

    retries: number

    The number of retries. Starts at 0, increases by 1 for each call to next(). Resets to 0 when reset() is called.

    • Returns the current number in the series and advances the series by one step.

      Returns number

      the current number in the series