Class RetryHandler<T>


  • public class RetryHandler<T>
    extends java.lang.Object
    A retry handler controls the retries for a particular request.
    • Constructor Summary

      Constructors 
      Constructor Description
      RetryHandler​(RetryStrategy strategy)
      Construct a new retry handler instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<T> delayRequest​(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> action, int delayMillis)  
      java.util.concurrent.CompletableFuture<T> execute​(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> action)  
      static boolean isRetryable​(java.lang.Throwable exc)  
      java.util.concurrent.CompletableFuture<T> rethrow​(java.lang.Throwable throwable)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RetryHandler

        public RetryHandler​(RetryStrategy strategy)
        Construct a new retry handler instance.
        Parameters:
        strategy - The retry strategy to use.
    • Method Detail

      • delayRequest

        public java.util.concurrent.CompletableFuture<T> delayRequest​(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> action,
                                                                      int delayMillis)
      • isRetryable

        public static boolean isRetryable​(java.lang.Throwable exc)
      • rethrow

        public java.util.concurrent.CompletableFuture<T> rethrow​(java.lang.Throwable throwable)
      • execute

        public java.util.concurrent.CompletableFuture<T> execute​(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> action)