Type alias RetryPolicy

RetryPolicy: {
    backoffFactor?: number;
    initialInterval?: number;
    jitter?: boolean;
    maxAttempts?: number;
    maxInterval?: number;
    retryOn?: ((e) => boolean);
}

Type declaration

  • Optional backoffFactor?: number

    Multiplier by which the interval increases after each retry.

    Default

    2
    
  • Optional initialInterval?: number

    Amount of time that must elapse before the first retry occurs in milliseconds.

    Default

    500
    
  • Optional jitter?: boolean

    Whether to add random jitter to the interval between retries.

  • Optional maxAttempts?: number

    Maximum amount of time that may elapse between retries.

    Default

    3
    
  • Optional maxInterval?: number

    Maximum amount of time that may elapse between retries in milliseconds.

    Default

    128000
    
  • Optional retryOn?: ((e) => boolean)

    A function that returns True for exceptions that should trigger a retry.

      • (e): boolean
      • Parameters

        • e: any

        Returns boolean