Interface BackOffDelayPolicy

    • Field Detail

      • TIMEOUT

        static final Duration TIMEOUT
    • Method Detail

      • fixed

        static BackOffDelayPolicy fixed​(Duration delay)
        A policy with a constant delay.
        Parameters:
        delay -
        Returns:
        the constant delay policy
      • fixedWithInitialDelay

        static BackOffDelayPolicy fixedWithInitialDelay​(Duration initialDelay,
                                                        Duration delay)
        A policy with a first delay and then a constant delay.
        Parameters:
        initialDelay -
        delay -
        Returns:
        the policy with an initial delay
      • fixedWithInitialDelay

        static BackOffDelayPolicy fixedWithInitialDelay​(Duration initialDelay,
                                                        Duration delay,
                                                        Duration timeout)
        A policy with a first delay, then a constant delay until a timeout is reached.
        Parameters:
        initialDelay -
        delay -
        timeout -
        Returns:
        the policy with an initial delay
      • delay

        Duration delay​(int recoveryAttempt)
        Returns the delay to use for a given attempt.

        The policy can return the TIMEOUT constant to indicate that the task has reached a timeout.

        Parameters:
        recoveryAttempt -
        Returns:
        the delay, TIMEOUT if the task should stop being retried