Package org.infinispan.util
Class ExponentialBackOffImpl
java.lang.Object
org.infinispan.util.ExponentialBackOffImpl
- All Implemented Interfaces:
ExponentialBackOff
The default
ExponentialBackOff
implementation for IRAC (asynchronous cross-site replication).
An exponential back-off implementation with min interval of 500 ms and a maximum of 300'000 ms (5 min). It uses a multiplier of 2 (each timeslot will be increase + 100% for each consecutive retry) and the final wait time is randomized, +- 50% of the timeslot.
- Since:
- 12.0
- Author:
- Pedro Ruivo
-
Field Summary
Fields inherited from interface org.infinispan.util.ExponentialBackOff
NO_OP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIt returns aCompletionStage
which is completed a certain amount of time before retries the request.void
reset()
Resets its state.
-
Constructor Details
-
ExponentialBackOffImpl
-
-
Method Details
-
reset
public void reset()Description copied from interface:ExponentialBackOff
Resets its state.The blocking time in
ExponentialBackOff.asyncBackOff()
increases with the number of consecutive retries. This methods resets its state back to the initial sleep time.- Specified by:
reset
in interfaceExponentialBackOff
-
asyncBackOff
Description copied from interface:ExponentialBackOff
It returns aCompletionStage
which is completed a certain amount of time before retries the request.After the completion, the request is allows to proceed.
- Specified by:
asyncBackOff
in interfaceExponentialBackOff
- Returns:
- A
CompletionStage
.
-