public final class RetryStrategies
extends Object
Publisher.retryWhen(BiIntFunction),
Single.retryWhen(BiIntFunction), and Completable.retryWhen(BiIntFunction) or in general.| Modifier and Type | Method and Description |
|---|---|
static BiIntFunction<Throwable,Completable> |
retryWithConstantBackoffDeltaJitter(int maxRetries,
Predicate<Throwable> causeFilter,
Duration delay,
Duration jitter,
Executor timerExecutor)
Creates a new retry function that adds the passed constant
Duration as a delay between retries. |
static BiIntFunction<Throwable,Completable> |
retryWithConstantBackoffDeltaJitter(Predicate<Throwable> causeFilter,
Duration delay,
Duration jitter,
Executor timerExecutor)
Creates a new retry function that adds the passed constant
Duration as a delay between retries. |
static BiIntFunction<Throwable,Completable> |
retryWithConstantBackoffFullJitter(int maxRetries,
Predicate<Throwable> causeFilter,
Duration delay,
Executor timerExecutor)
Creates a new retry function that adds the passed constant
Duration as a delay between retries. |
static BiIntFunction<Throwable,Completable> |
retryWithConstantBackoffFullJitter(Predicate<Throwable> causeFilter,
Duration delay,
Executor timerExecutor)
Creates a new retry function that adds the passed constant
Duration as a delay between retries. |
static BiIntFunction<Throwable,Completable> |
retryWithExponentialBackoffDeltaJitter(int maxRetries,
Predicate<Throwable> causeFilter,
Duration initialDelay,
Duration jitter,
Duration maxDelay,
Executor timerExecutor)
Creates a new retry function that adds a delay between retries.
|
static BiIntFunction<Throwable,Completable> |
retryWithExponentialBackoffDeltaJitter(Predicate<Throwable> causeFilter,
Duration initialDelay,
Duration jitter,
Duration maxDelay,
Executor timerExecutor)
Creates a new retry function that adds a delay between retries.
|
static BiIntFunction<Throwable,Completable> |
retryWithExponentialBackoffFullJitter(int maxRetries,
Predicate<Throwable> causeFilter,
Duration initialDelay,
Duration maxDelay,
Executor timerExecutor)
Creates a new retry function that adds a delay between retries.
|
static BiIntFunction<Throwable,Completable> |
retryWithExponentialBackoffFullJitter(Predicate<Throwable> causeFilter,
Duration initialDelay,
Duration maxDelay,
Executor timerExecutor)
Creates a new retry function that adds a delay between retries.
|
public static BiIntFunction<Throwable,Completable> retryWithConstantBackoffFullJitter(int maxRetries, Predicate<Throwable> causeFilter, Duration delay, Executor timerExecutor)
Duration as a delay between retries.
This additionally adds a "Full Jitter" for the backoff as described
here.maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return
a failed Completable with the passed Throwable as the causecauseFilter - A Predicate that selects whether a Throwable cause should be retrieddelay - Constant Duration of delay between retriestimerExecutor - Executor to be used to schedule timers for backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithConstantBackoffFullJitter(Predicate<Throwable> causeFilter, Duration delay, Executor timerExecutor)
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 causecauseFilter - A Predicate that selects whether a Throwable cause should be retrieddelay - Constant Duration of delay between retriestimerExecutor - Executor to be used to schedule timers for backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithConstantBackoffDeltaJitter(Predicate<Throwable> causeFilter, Duration delay, Duration jitter, Executor timerExecutor)
Duration as a delay between retries.causeFilter - A Predicate that selects whether a Throwable cause should be retrieddelay - Constant Duration of delay between retriesjitter - The jitter to apply to delay on each retry.timerExecutor - Executor to be used to schedule timers for backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithConstantBackoffDeltaJitter(int maxRetries, Predicate<Throwable> causeFilter, Duration delay, Duration jitter, Executor timerExecutor)
Duration as a delay between retries.maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return
a failed Completable with the passed Throwable as the causecauseFilter - A Predicate that selects whether a Throwable cause should be retrieddelay - Constant Duration of delay between retriesjitter - The jitter to apply to delay on each retry.timerExecutor - Executor to be used to schedule timers for backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithExponentialBackoffFullJitter(Predicate<Throwable> causeFilter, Duration initialDelay, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent retries.
This additionally adds a "Full Jitter" for the backoff as described
here.causeFilter - A Predicate that selects whether a Throwable cause should be retriedinitialDelay - Delay Duration for the first retry and increased exponentially with each retrymaxDelay - The maximum amount of delay that will be introduced.timerExecutor - Executor to be used to schedule timers for backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithExponentialBackoffFullJitter(int maxRetries, Predicate<Throwable> causeFilter, Duration initialDelay, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent retries.
This additionally adds a "Full Jitter" for the backoff as described
here.maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return
a failed Completable with the passed Throwable as the causecauseFilter - A Predicate that selects whether a Throwable cause should be retriedinitialDelay - Delay Duration for the first retry and increased exponentially with each retrymaxDelay - The maximum amount of delay that will be introduced.timerExecutor - Executor to be used to schedule timers for backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithExponentialBackoffDeltaJitter(Predicate<Throwable> causeFilter, Duration initialDelay, Duration jitter, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent retries.causeFilter - A Predicate that selects whether a Throwable cause should be retriedinitialDelay - Delay Duration for the first retry and increased exponentially with each retryjitter - 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 backoffBiIntFunction 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 Throwablepublic static BiIntFunction<Throwable,Completable> retryWithExponentialBackoffDeltaJitter(int maxRetries, Predicate<Throwable> causeFilter, Duration initialDelay, Duration jitter, Duration maxDelay, Executor timerExecutor)
initialDelay which is increased exponentially for subsequent retries.maxRetries - Maximum number of allowed retries, after which the returned BiIntFunction will return
a failed Completable with the passed Throwable as the causecauseFilter - A Predicate that selects whether a Throwable cause should be retriedinitialDelay - Delay Duration for the first retry and increased exponentially with each retryjitter - 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 backoffBiIntFunction 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