Class RetryStrategies

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffDeltaJitter​(int maxRetries, java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration delay, java.time.Duration jitter, Executor timerExecutor)
      Creates a new retry function that adds the passed constant Duration as a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffDeltaJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration delay, java.time.Duration jitter, Executor timerExecutor)
      Creates a new retry function that adds the passed constant Duration as a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffFullJitter​(int maxRetries, java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration delay, Executor timerExecutor)
      Creates a new retry function that adds the passed constant Duration as a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffFullJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration delay, Executor timerExecutor)
      Creates a new retry function that adds the passed constant Duration as a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffDeltaJitter​(int maxRetries, java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration initialDelay, java.time.Duration jitter, java.time.Duration maxDelay, Executor timerExecutor)
      Creates a new retry function that adds a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffDeltaJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration initialDelay, java.time.Duration jitter, java.time.Duration maxDelay, Executor timerExecutor)
      Creates a new retry function that adds a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffFullJitter​(int maxRetries, java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration initialDelay, java.time.Duration maxDelay, Executor timerExecutor)
      Creates a new retry function that adds a delay between retries.
      static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffFullJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter, java.time.Duration initialDelay, java.time.Duration maxDelay, Executor timerExecutor)
      Creates a new retry function that adds a delay between retries.
      • Methods inherited from class java.lang.Object

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

      • retryWithConstantBackoffFullJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffFullJitter​(int maxRetries,
                                                                                                              java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                              java.time.Duration delay,
                                                                                                              Executor timerExecutor)
        Creates a new retry function that adds the passed constant Duration as a delay between retries. This additionally adds a "Full Jitter" for the backoff as described here.
        Parameters:
        maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return a failed Completable with the passed Throwable as the cause
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        delay - Constant Duration of delay between retries
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithConstantBackoffFullJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffFullJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                              java.time.Duration delay,
                                                                                                              Executor timerExecutor)
        Creates a new retry function that adds the passed constant Duration as a delay between retries. This additionally adds a "Full Jitter" for the backoff as described here. a failed Completable with the passed Throwable as the cause
        Parameters:
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        delay - Constant Duration of delay between retries
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithConstantBackoffDeltaJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffDeltaJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                               java.time.Duration delay,
                                                                                                               java.time.Duration jitter,
                                                                                                               Executor timerExecutor)
        Creates a new retry function that adds the passed constant Duration as a delay between retries.
        Parameters:
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        delay - Constant Duration of delay between retries
        jitter - The jitter to apply to delay on each retry.
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithConstantBackoffDeltaJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithConstantBackoffDeltaJitter​(int maxRetries,
                                                                                                               java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                               java.time.Duration delay,
                                                                                                               java.time.Duration jitter,
                                                                                                               Executor timerExecutor)
        Creates a new retry function that adds the passed constant Duration as a delay between retries.
        Parameters:
        maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return a failed Completable with the passed Throwable as the cause
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        delay - Constant Duration of delay between retries
        jitter - The jitter to apply to delay on each retry.
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithExponentialBackoffFullJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffFullJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                                 java.time.Duration initialDelay,
                                                                                                                 java.time.Duration maxDelay,
                                                                                                                 Executor timerExecutor)
        Creates a new retry function that adds a delay between retries. For first retry, the delay is initialDelay which is increased exponentially for subsequent retries. This additionally adds a "Full Jitter" for the backoff as described here.
        Parameters:
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        initialDelay - Delay Duration for the first retry and increased exponentially with each retry
        maxDelay - The maximum amount of delay that will be introduced.
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithExponentialBackoffFullJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffFullJitter​(int maxRetries,
                                                                                                                 java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                                 java.time.Duration initialDelay,
                                                                                                                 java.time.Duration maxDelay,
                                                                                                                 Executor timerExecutor)
        Creates a new retry function that adds a delay between retries. For first retry, the delay is initialDelay which is increased exponentially for subsequent retries. This additionally adds a "Full Jitter" for the backoff as described here.
        Parameters:
        maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return a failed Completable with the passed Throwable as the cause
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        initialDelay - Delay Duration for the first retry and increased exponentially with each retry
        maxDelay - The maximum amount of delay that will be introduced.
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithExponentialBackoffDeltaJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffDeltaJitter​(java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                                  java.time.Duration initialDelay,
                                                                                                                  java.time.Duration jitter,
                                                                                                                  java.time.Duration maxDelay,
                                                                                                                  Executor timerExecutor)
        Creates a new retry function that adds a delay between retries. For first retry, the delay is initialDelay which is increased exponentially for subsequent retries.
        Parameters:
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        initialDelay - Delay Duration for the first retry and increased exponentially with each retry
        jitter - The jitter to apply to delay on each retry.
        maxDelay - The maximum amount of delay that will be introduced.
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable
      • retryWithExponentialBackoffDeltaJitter

        public static BiIntFunction<java.lang.Throwable,​Completable> retryWithExponentialBackoffDeltaJitter​(int maxRetries,
                                                                                                                  java.util.function.Predicate<java.lang.Throwable> causeFilter,
                                                                                                                  java.time.Duration initialDelay,
                                                                                                                  java.time.Duration jitter,
                                                                                                                  java.time.Duration maxDelay,
                                                                                                                  Executor timerExecutor)
        Creates a new retry function that adds a delay between retries. For first retry, the delay is initialDelay which is increased exponentially for subsequent retries.
        Parameters:
        maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return a failed Completable with the passed Throwable as the cause
        causeFilter - A Predicate that selects whether a Throwable cause should be retried
        initialDelay - Delay Duration for the first retry and increased exponentially with each retry
        jitter - The jitter to apply to delay on each retry.
        maxDelay - The maximum amount of delay that will be introduced.
        timerExecutor - Executor to be used to schedule timers for backoff
        Returns:
        A BiIntFunction to be used for retries which given a retry count and a Throwable returns a Completable that terminates successfully when the source has to be retried or terminates with error if the source should not be retried for the passed Throwable