Class FullJitterDelay

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

public class FullJitterDelay extends Object implements DelayStrategy
Full jitter strategy that applies complete randomization to the exponential backoff delay.
Author:
Nikita Koksharov
  • Constructor Details

    • FullJitterDelay

      public FullJitterDelay(Duration baseDelay, Duration maxDelay)
      Creates a full jitter delay strategy with exponential backoff.
      Parameters:
      baseDelay - the base delay duration for the first retry attempt
      maxDelay - the maximum delay duration to cap the exponential growth
  • 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