Package | Description |
---|---|
dev.failsafe |
APIs for performing failsafe executions.
|
Modifier and Type | Method and Description |
---|---|
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortIf(CheckedBiPredicate<R,? extends Throwable> completionPredicate)
Specifies that retries should be aborted if the
completionPredicate matches the completion result. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortIf(CheckedPredicate<R> resultPredicate)
Specifies that retries should be aborted if the
resultPredicate matches the result. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortOn(CheckedPredicate<? extends Throwable> abortPredicate)
Specifies that retries should be aborted if the
abortPredicate matches the exception. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortOn(Class<? extends Throwable>... exceptions)
Specifies when retries should be aborted.
|
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortOn(Class<? extends Throwable> exception)
Specifies when retries should be aborted.
|
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortOn(List<Class<? extends Throwable>> exceptions)
Specifies when retries should be aborted.
|
RetryPolicyBuilder<R> |
RetryPolicyBuilder.abortWhen(R result)
Specifies that retries should be aborted if the execution result matches the
result . |
static <R> RetryPolicyBuilder<R> |
RetryPolicy.builder()
Creates a RetryPolicyBuilder that by default will build a RetryPolicy that allows 3 execution attempts max with no
delay, unless configured otherwise.
|
static <R> RetryPolicyBuilder<R> |
RetryPolicy.builder(RetryPolicyConfig<R> config)
Creates a new RetryPolicyBuilder that will be based on the
config . |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.onAbort(EventListener<ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution is aborted. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.onFailedAttempt(EventListener<ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called when an execution attempt fails. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.onRetriesExceeded(EventListener<ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when an execution fails and the max retry attempts or max duration
are exceeded. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.onRetry(EventListener<ExecutionAttemptedEvent<R>> listener)
Registers the
listener to be called when a retry is about to be attempted. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.onRetryScheduled(EventListener<ExecutionScheduledEvent<R>> listener)
Registers the
listener to be called when a retry for an async call is about to be scheduled. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withBackoff(Duration delay,
Duration maxDelay)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
consecutive delays by a factor of 2. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withBackoff(Duration delay,
Duration maxDelay,
double delayFactor)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
consecutive delays by the delayFactor . |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withBackoff(long delay,
long maxDelay,
ChronoUnit chronoUnit)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
consecutive delays by a factor of 2. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withBackoff(long delay,
long maxDelay,
ChronoUnit chronoUnit,
double delayFactor)
Sets the
delay between retries, exponentially backing off to the maxDelay and multiplying
consecutive delays by the delayFactor . |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withDelay(Duration delay)
Sets the fixed
delay to occur between retries. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withDelay(Duration delayMin,
Duration delayMax)
Sets a random delay between the
delayMin and delayMax (inclusive) to occur between retries. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withDelay(long delayMin,
long delayMax,
ChronoUnit chronoUnit)
Sets a random delay between the
delayMin and delayMax (inclusive) to occur between retries. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withJitter(double jitterFactor)
Sets the
jitterFactor to randomly vary retry delays by. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withJitter(Duration jitter)
Sets the
jitter to randomly vary retry delays by. |
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withMaxAttempts(int maxAttempts)
Sets the max number of execution attempts to perform.
|
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withMaxDuration(Duration maxDuration)
Sets the max duration to perform retries for, else the execution will be failed.
|
RetryPolicyBuilder<R> |
RetryPolicyBuilder.withMaxRetries(int maxRetries)
Sets the max number of retries to perform when an execution attempt fails.
|
Copyright © 2022. All rights reserved.