Class ConstantDelay

java.lang.Object
org.redisson.config.ConstantDelay
All Implemented Interfaces:
DelayStrategy

public class ConstantDelay extends Object implements DelayStrategy
A constant delay strategy that returns the same delay duration for every retry attempt.
Author:
Nikita Koksharov
  • Constructor Details

    • ConstantDelay

      public ConstantDelay(Duration delay)
      Creates a constant delay strategy with the specified delay duration.
      Parameters:
      delay - the fixed delay duration to use between retry attempts
  • Method Details

    • calcDelay

      public Duration calcDelay(int attempt)
      Description copied from interface: DelayStrategy
      Calculates the delay duration to wait before the next retry attempt.
      Specified by:
      calcDelay in interface DelayStrategy
      Parameters:
      attempt - the zero-based retry attempt number (0 = first retry)
      Returns:
      the duration to wait before the next retry attempt