io.vertx.circuitbreaker

## Interface RetryPolicy

- Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface RetryPolicy

  A policy for retry execution.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RetryPolicy` | `constantDelay(long delay)` Create a constant delay retry policy.
    `long` | `delay(Throwable failure, int retryCount)` Compute a delay in milliseconds before retry is executed.
    `static RetryPolicy` | `exponentialDelayWithJitter(long initialDelay, long maxDelay)` Create an exponential delay with jitter retry policy.
    `static RetryPolicy` | `linearDelay(long initialDelay, long maxDelay)` Create a linear delay retry policy.

- - ### Method Detail

    - #### constantDelay

          static RetryPolicy constantDelay(long delay)

      Create a constant delay retry policy.
      Parameters:
        `delay` - the constant delay in milliseconds

    - #### linearDelay

          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

          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

    - #### delay

          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

Copyright © 2024 Eclipse. All rights reserved.