Changelog
2.0.2
IDisposable
Changelog
2.0.0 - 2020-09-24
breaking: reactor: introduce a separate BackoffFactory interface for the first backoff
This only requires changes if you use retry policies in your own code, outside of the Policy.retry()
.
See #30. For some backoff policies, such as delegate and exponential policies, the first backoff was always 0, before next()
was called. This is undesirable, and fixing it involved separating the backoff factory from the backoff itself.
The backoff classes, such as DelegateBackoff
and ExponentialBackoff
, now only have a next()
method. The duration
, which is now a property instead of a method, is only available after the first next()
call.
For example, previously if you did this:
let backoff = new ExponentialBackoff();
while (!succeeded) {
if (!tryAgain()) {
await delay(backoff.duration());
backoff = backoff.next();
}
}
You now need to call next()
before you access duration
:
let backoff = new ExponentialBackoff();
while (!succeeded) {
if (!tryAgain()) {
backoff = backoff.next();
await delay(backoff.duration);
}
}
Note: if you use typescript, you will need another variable for it to understand you. Here's an example of how we use it inside the RetryPolicy.
Changelog
1.0.1 - 2020-06-22
Changelog
1.0.0 - 2020-06-16
FallbackPolicy.onFallback
is replaced with FallbackPolicy.onFailure
. When a failure happens, a fallback will occur.isBrokenCircuitError
, isBulkheadRejectedError
, isIsolatedCircuitError
, isTaskCancelledError
methods to the errors and matching predicate functions.onFailure
and onSuccess
callbacks for monitoring purposes (see #20)onHalfOpen
event to the circuit breaker (see #18)retry.exponential()
requiring an argument when it should have been optional (see #18)Changelog
0.1.5 - 2020-03-01
.dangerouslyUnref
methods for timeouts and retries (#11, thanks to @novemberborn)Changelog
0.1.4 - 2020-02-24
Timeout.Aggressive
triggering timeouts immediately (#16, thanks to @ekillops)