Private Readonly _aftPrivate _backPrivate _currentPrivate _delayPrivate _errPrivate _failPrivate _maxPrivate _maxPrivate _rejectPrivate _resultPrivate Readonly _retryablePrivate _successPrivate _totalPrivate _totala boolean indicating if the result of the retryable eventually passed the
condition successfully. a value of false indicates that either a maximum
duration or number of attempts was reached before success. this can be used if
RetryConfig.errorOnFail is set to false
the last error returned by the retryable (if any). this can be used if
RetryConfig.errorOnFail is set to false
the last result returned by the retryable or undefined. this can be used
if RetryConfig.errorOnFail is set to false
the total number of attempts actually executed at the time this is called. this
can be used if RetryConfig.errorOnFail is set to false
the total amount of time spent calling the retryable until it succeeded
or reached the maximum duration or number of attempts. this can be used if
RetryConfig.errorOnFail is set to false
Private _checkPrivate _istests the passed in result against the specified condition to
determine if it succeeds
a value to test the condition
true if the result successfully passes the condition
otherwise false
Private _shouldallows for specifying a custom condition to determine the success of calling
the retryable (default is if the retryable returns a non-null and non-undefined result)
a function that accepts an argument of type T and returns
a boolean result based on a comparison of the argument with an expectation
the current Retry<T> instance
a value indicating if the delay between retry attempts remains the same each time or increases based on some calculation
the current Retry<T> instance
'constant'
the amount of time in milliseconds between attempts
NOTE
this is only the starting amount if using a
RetryBackOffTypeoflinearorexponentialas the value will continually increase on each retry attempt.
the current Retry<T> instance
1
allows for specifying a function that will be called each time the
retryable is called and doesn't succeed (doesn't pass the condition)
an Func<void, void | PromiseLike<void>> accepting no arguments and returning nothing
the current Retry<T> instance
Static calculatecalculates the number of milliseconds to delay between retry attempts using a
RetryBackOffType to determine if the value should increase and how if so.
Ex:
Retry.calculateBackOffDelay(10, 200, 'linear'); // returns 210
Retry.calculateBackOffDelay(10, 200, 'exponential'); // returns 400
Retry.calculateBackOffDelay(10, 200, 'constant'); // returns 10
the number of milliseconds delay at the start
the number of milliseconds delay last used
the RetryBackOffType delay type to use
the number of milliseconds to delay next time
Generated using TypeDoc
a class used to retry some action until some condition is met. the result of the action is passed to the condition function and the end result is returned from the
untilfunction (orundefinedif the condition is never met and all retry attempts are used up)