Class RetryPolicy

java.lang.Object
io.vertx.mutiny.circuitbreaker.RetryPolicy
All Implemented Interfaces:
MutinyDelegate

public class RetryPolicy extends Object implements MutinyDelegate
A policy for retry execution.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • RetryPolicy
  • Field Details

  • Constructor Details

    • RetryPolicy

      public RetryPolicy(io.vertx.circuitbreaker.RetryPolicy delegate)
      Create a new instance of RetryPolicy delegating to the given (non-null) instance of RetryPolicy.
    • RetryPolicy

      public RetryPolicy(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.circuitbreaker.RetryPolicy getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • constantDelay

      public static RetryPolicy constantDelay(long delay)
      Create a constant delay retry policy.
      Parameters:
      delay - the constant delay in milliseconds
    • 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
    • exponentialDelayWithJitter

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

      Based on the Full Jitter approach described in Exponential Backoff And Jitter.

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

      public long delay(Throwable failure, int retryCount)
      Compute a delay in milliseconds before retry is executed.
      Parameters:
      failure - the failure of the previous execution attempt
      retryCount - the number of times operation has been retried already
      Returns:
      a delay in milliseconds before retry is executed
    • newInstance

      public static RetryPolicy newInstance(io.vertx.circuitbreaker.RetryPolicy delegate)
      Creates a new instance of the RetryPolicy.
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object