Class RetryPolicy


  • public class RetryPolicy
    extends Object
    A policy for retry execution.

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • RetryPolicy

        public RetryPolicy​(RetryPolicy delegate)
      • RetryPolicy

        public RetryPolicy​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • constantDelay

        public static RetryPolicy constantDelay​(long delay)
        Create a constant delay retry policy.
        Parameters:
        delay - the constant delay in milliseconds
        Returns:
      • linearDelay

        public static RetryPolicy linearDelay​(long initialDelay,
                                              long maxDelay)
        Create a linear delay retry policy.
        Parameters:
        initialDelay - the initial delay in milliseconds
        maxDelay - maximum delay in milliseconds
        Returns:
      • exponentialDelayWithJitter

        public static RetryPolicy exponentialDelayWithJitter​(long initialDelay,
                                                             long maxDelay)
        Create an exponential delay with jitter retry policy.

        Based on Full Jitter in Exponential Backoff And Jitter.

        Parameters:
        initialDelay - the initial delay in milliseconds
        maxDelay - maximum delay in milliseconds
        Returns:
      • delay

        public long delay​(Throwable failure,
                          int retryCount)
        Compute a delay in milliseconds before retry is executed.
        Parameters:
        failure - the failure passed to the operation Promise
        retryCount - the number of times operation has been retried already
        Returns:
        a delay in milliseconds before retry is executed