Private
requirePrivate
Readonly
retryPrivate
retryAdd retry event listener to this attempt, so that listening each events
Add some retry event listeners to this attempt. This stacks listeners, so those subscribe events by popping.
return this
Private
doPrivate
doTrys attempting and handles producers.
If another
is passed, exhausting attempts, execute another
.
Optional
another: (() => Promise<T>)Executing producer
until exhausting along with RetryPolicy
.
After exhausted, return default value.
Executing producer
until exhausting along with RetryPolicy
.
After exhausted, try to evaluate another
function.
Executing producer
until exhausting along with RetryPolicy
.
Return a result of producer
, or default value when exhausted.
Producer function
Another result when attempt failed
Private
logPrivate
notifyNotify all listeners of a retry event on error. RetryEventOnFailed of message to notify is created from RetryContext.
Private
notifyNotify all listeners of a retry event on success. RetryEventOnSuccess of message to notify is created from RetryContext.
Private
waitGenerated using TypeDoc
Attempt handler. This class organizes a retry context and policy so that handles some attempts