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 Details

    • ExponentialBackOff

      public ExponentialBackOff()
  • Method Details

    • create

      public LockOptions.BackOffPolicy create()
      Specified by:
      create in interface LockOptions.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()