Module methanol

Interface RetryInterceptor.BackoffStrategy

  • Enclosing class:
    RetryInterceptor
    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 static interface RetryInterceptor.BackoffStrategy
    A strategy for backing off (delaying) before a retry.
    • Method Detail

      • backoff

        java.time.Duration backoff​(RetryInterceptor.Context<?> context)
        Returns the Duration to wait for before retrying the request for the given retry number.
      • withJitter

        default RetryInterceptor.BackoffStrategy withJitter​(double factor)
        Returns a BackoffStrategy that applies full jitter to this BackoffStrategy, where the degree of "fullness" is specified by the given factor.
      • linear

        static RetryInterceptor.BackoffStrategy linear​(java.time.Duration base,
                                                       java.time.Duration cap)
        Returns a BackoffStrategy that applies a linearly increasing delay every retry, where base specifies the first delay, and cap specifies the maximum delay.
      • exponential

        static RetryInterceptor.BackoffStrategy exponential​(java.time.Duration base,
                                                            java.time.Duration cap)
        Returns a BackoffStrategy that applies an exponentially (base 2) increasing delay every retry, where base specifies the first delay, and cap specifies the maximum delay.