Package org.redisson.config
Class DecorrelatedJitterDelay
java.lang.Object
org.redisson.config.DecorrelatedJitterDelay
- All Implemented Interfaces:
DelayStrategy
Decorrelated jitter strategy that increases delay exponentially while introducing
randomness influenced by the previous backoff duration. This approach helps avoid
exponential growth that could lead to excessively long delays while ensuring each
backoff duration is decorrelated from its predecessor.
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorsConstructorDescriptionDecorrelatedJitterDelay(Duration minDelay, Duration maxDelay) Creates a decorrelated jitter delay strategy. -
Method Summary
-
Constructor Details
-
DecorrelatedJitterDelay
Creates a decorrelated jitter delay strategy.- Parameters:
minDelay- the minimum delay duration (base delay)maxDelay- the maximum allowable delay duration
-
-
Method Details
-
calcDelay
Description copied from interface:DelayStrategyCalculates the delay duration to wait before the next retry attempt.- Specified by:
calcDelayin interfaceDelayStrategy- Parameters:
attempt- the zero-based retry attempt number (0 = first retry)- Returns:
- the duration to wait before the next retry attempt
-