RetryOptions: {
    backOffType?: RetryBackOffType;
    delay?: number;
    errorOnFail?: boolean;
    failAction?: Func<void, void | PromiseLike<void>>;
    maxAttempts?: number;
    maxDuration?: number;
}

Type declaration

  • Optional backOffType?: RetryBackOffType

    a value indicating if the delay between retry attempts remains the same each time or increases based on some calculation

    Default

    'constant'
    
  • Optional delay?: number

    the amount of time in milliseconds between attempts

    NOTE

    this is only the starting amount if using a RetryBackOffType of linear or exponential as the value will continually increase on each retry attempt.

    Default

    1
    
  • Optional errorOnFail?: boolean

    if set to true then an Error will be thrown after the last attempt has failed

    Default

    true
    
  • Optional failAction?: Func<void, void | PromiseLike<void>>

    allows for specifying a function that will be called each time the retryable is called and doesn't succeed (doesn't pass the condition)

    Param

    an Func<void, void | PromiseLike<void>> accepting no arguments and returning nothing

    Returns

    the current Retry<T> instance

  • Optional maxAttempts?: number

    the maximum number of retry attempts to make before giving up. leaving this unset or set to a value of Infinity means there is no limit

    Default

    Infinity
    
  • Optional maxDuration?: number

    the maximum number of milliseconds to attempt retries. leaving this unset or set to a value of Infinity means there is no duration limit

    Default

    Infinity
    

Generated using TypeDoc