Package org.redisson.api
Class LockOptions.ExponentialBackOff
- java.lang.Object
-
- org.redisson.api.LockOptions.ExponentialBackOff
-
- All Implemented Interfaces:
LockOptions.BackOff
- Enclosing class:
- LockOptions
public static class LockOptions.ExponentialBackOff extends Object implements LockOptions.BackOff
Back off algorithm, where sleep period starts with initialDelay, each time increases multiplier times but doesn't exceed maxDelay
-
-
Constructor Summary
Constructors Constructor Description ExponentialBackOff()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockOptions.BackOffPolicy
create()
long
getInitialDelay()
long
getMaxDelay()
int
getMultiplier()
LockOptions.ExponentialBackOff
initialDelay(long initialDelay)
Sets initial back off delay.LockOptions.ExponentialBackOff
maxDelay(long maxDelay)
Sets max back off delay.LockOptions.ExponentialBackOff
multiplier(int multiplier)
Sets back off delay multiplier.
-
-
-
Method Detail
-
create
public LockOptions.BackOffPolicy create()
- Specified by:
create
in interfaceLockOptions.BackOff
-
maxDelay
public LockOptions.ExponentialBackOff maxDelay(long maxDelay)
Sets max back off delay.Default is
128
- Parameters:
maxDelay
- - max sleep period. Has to be positive- Returns:
- ExponentialBackOffOptions instance
-
getMaxDelay
public long getMaxDelay()
-
initialDelay
public LockOptions.ExponentialBackOff initialDelay(long initialDelay)
Sets initial back off delay.Default is
1
- Parameters:
initialDelay
- - initial sleep period. Has to be positive- Returns:
- ExponentialBackOffOptions instance
-
getInitialDelay
public long getInitialDelay()
-
multiplier
public LockOptions.ExponentialBackOff multiplier(int multiplier)
Sets back off delay multiplier.Default is
2
- Parameters:
multiplier
- - sleep period multiplier. Has to be positive- Returns:
- ExponentialBackOffOptions instance
-
getMultiplier
public int getMultiplier()
-
-