- Add support for specifying the factor to use in the
ExponentialStrategy
.
- Replace
FunctionCall.getResults
byFunctionCall.getLastResult
to avoid storing intermediary results forever as this may lead to memory exhaustion when used in conjunction with an infinite number of backoffs. - Add
FunctionCall.getNumRetries
which returns the number of times the wrapped function was retried.
- Add four new methods to
FunctionCall
to query the state of the call.- isPending
- isRunning
- isCompleted
- isAborted
- To match
Backoff
default behavior,FunctionCall
no longer sets a default failAfter of 5, i.e. the maximum number of backoffs is now unbounded by default.
Backoff.backoff
now accepts an optional error argument that is re-emitted as the last argument of thebackoff
andfail
events. This provides some context to the listeners as to why a given backoff operation was attempted.- The
backoff
event emitted by theFunctionCall
class now contains, as its last argument, the error that caused the backoff operation to be attempted. This provides some context to the listeners as to why a given backoff operation was attempted.
FunctionCall.call
renamed intoFunctionCall.start
.backoff.call
no longer invokes the wrapped function onnextTick
. That way, the first attempt is not delayed until the end of the current event loop.
- Make
FunctionCall.backoffFactory
a private member.
- Add
backoff.call
and the associatedFunctionCall
class.
- Add a
Backoff.failAfter
.
- Rename
start
anddone
eventsbackoff
andready
. - Remove deprecated
backoff.fibonnaci
.
- Create
backoff.fibonacci
. - Deprecate
backoff.fibonnaci
. - Expose fibonacci and exponential strategies.
- Provide exponential and fibonacci backoffs.
- Change
initialTimeout
andmaxTimeout
toinitialDelay
andmaxDelay
. - Use fibonnaci backoff.