java.lang.Object
software.amazon.cloudformation.proxy.delay.Constant
All Implemented Interfaces:
Delay
Direct Known Subclasses:
MultipleOf

public class Constant extends Object
Provides constant fixed delay seconds for each attempt until AbstractDelay.timeout has been reached. After which it will return -1 final Delay delay = Constant.of().delay(Duration.ofSeconds(5)) .timeout(Duration.ofSeconds(50)).build(); Duration next = Duration.ZERO; int attempt = 1; while ((next = fixed.nextDelay(attempt++)) != Duration.ZERO) { accrued += next; } Assertions.assertEquals(5*10, accrued);
  • Method Details

    • of

      public static Constant.Builder of()
    • nextDelay

      public Duration nextDelay(int attempt)
      Description copied from interface: Delay
      Returns the new delay amount to stabilize as defined by Duration time. This returns -1 to indicate that we are done with delays from this instance Different implementations can return different values
      Parameters:
      attempt - , starts with 1
      Returns:
      the next amount to wait for or Duration.ZERO to indicate delay is complete