Class FixedDelay

  • All Implemented Interfaces:
    Delay

    public class FixedDelay
    extends Object
    implements Delay
    A fixed duration based implementation of Delay.
    Since:
    1.7
    • Method Detail

      • of

        public static FixedDelay of​(Duration duration)
        Builds a fixed duration delay.
        Parameters:
        duration - the fixed duration
        Returns:
        a fixed delay
      • delay

        public Promise<Duration> delay​(Integer attempt)
        Builds a promise wrapping a duration that will instruct the caller how long to wait between retries.
        Specified by:
        delay in interface Delay
        Parameters:
        attempt - current retry attempt to provide sophisticated delay strategies
        Returns:
        a promise wrapping a duration that will instruct the caller how long to wait between retries.