Class FixedDelay

  • All Implemented Interfaces:
    Delay

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Promise<java.time.Duration> delay​(java.lang.Integer attempt)
      Builds a promise wrapping a duration that will instruct the caller how long to wait between retries.
      static FixedDelay of​(java.time.Duration duration)
      Builds a fixed duration delay.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • of

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

        public Promise<java.time.Duration> delay​(java.lang.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.