| Package | Description |
|---|---|
| net.jodah.failsafe |
Core Failsafe APIs for performing failsafe executions.
|
| Modifier and Type | Method and Description |
|---|---|
RetryPolicy<R> |
RetryPolicy.abortIf(BiPredicate<R,? extends Throwable> completionPredicate)
Specifies that retries should be aborted if the
completionPredicate matches the completion result. |
RetryPolicy<R> |
RetryPolicy.abortIf(Predicate<R> resultPredicate)
Specifies that retries should be aborted if the
resultPredicate matches the result. |
RetryPolicy<R> |
RetryPolicy.abortOn(Class<? extends Throwable>... failures)
Specifies when retries should be aborted.
|
RetryPolicy<R> |
RetryPolicy.abortOn(Class<? extends Throwable> failure)
Specifies when retries should be aborted.
|
RetryPolicy<R> |
RetryPolicy.abortOn(List<Class<? extends Throwable>> failures)
Specifies when retries should be aborted.
|
RetryPolicy<R> |
RetryPolicy.abortOn(Predicate<? extends Throwable> failurePredicate)
Specifies that retries should be aborted if the
failurePredicate matches the failure. |
RetryPolicy<R> |
RetryPolicy.abortWhen(R result)
Specifies that retries should be aborted if the execution result matches the
result. |
RetryPolicy<R> |
RetryPolicy.copy()
Returns a copy of this RetryPolicy.
|
RetryPolicy<R> |
RetryPolicy.onAbort(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution is aborted. |
RetryPolicy<R> |
RetryPolicy.onFailedAttempt(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called when an execution attempt fails. |
RetryPolicy<R> |
RetryPolicy.onRetriesExceeded(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution fails and the max retry attempts or max duration are exceeded. |
RetryPolicy<R> |
RetryPolicy.onRetry(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called before an execution is retried. |
RetryPolicy<R> |
RetryPolicy.withBackoff(long delay,
long maxDelay,
ChronoUnit chronoUnit)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
successive delays by a factor of 2. |
RetryPolicy<R> |
RetryPolicy.withBackoff(long delay,
long maxDelay,
ChronoUnit chronoUnit,
double delayFactor)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
successive delays by the delayFactor. |
RetryPolicy<R> |
RetryPolicy.withDelay(Duration delay)
Sets the
delay to occur between retries. |
RetryPolicy<R> |
RetryPolicy.withDelay(long delayMin,
long delayMax,
ChronoUnit chronoUnit)
Sets a random delay between the
delayMin and delayMax (inclusive) to occur between retries. |
RetryPolicy<R> |
RetryPolicy.withJitter(double jitterFactor)
Sets the
jitterFactor to randomly vary retry delays by. |
RetryPolicy<R> |
RetryPolicy.withJitter(Duration jitter)
Sets the
jitter to randomly vary retry delays by. |
RetryPolicy<R> |
RetryPolicy.withMaxAttempts(int maxAttempts)
Sets the max number of execution attempts to perform.
|
RetryPolicy<R> |
RetryPolicy.withMaxDuration(Duration maxDuration)
Sets the max duration to perform retries for, else the execution will be failed.
|
RetryPolicy<R> |
RetryPolicy.withMaxRetries(int maxRetries)
Sets the max number of retries to perform when an execution attempt fails.
|
Copyright © 2020. All rights reserved.