Uses of Class
dev.failsafe.RetryPolicyBuilder
Packages that use RetryPolicyBuilder
-
Uses of RetryPolicyBuilder in dev.failsafe
Methods in dev.failsafe that return RetryPolicyBuilderModifier and TypeMethodDescriptionRetryPolicyBuilder.abortIf(CheckedBiPredicate<R, ? extends Throwable> completionPredicate) Specifies that retries should be aborted if thecompletionPredicatematches the completion result.RetryPolicyBuilder.abortIf(CheckedPredicate<R> resultPredicate) Specifies that retries should be aborted if theresultPredicatematches the result.RetryPolicyBuilder.abortOn(CheckedPredicate<? extends Throwable> abortPredicate) Specifies that retries should be aborted if theabortPredicatematches the exception.Specifies when retries should be aborted.final RetryPolicyBuilder<R> Specifies when retries should be aborted.Specifies when retries should be aborted.Specifies that retries should be aborted if the execution result matches theresult.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 theconfig.RetryPolicyBuilder.onAbort(EventListener<ExecutionCompletedEvent<R>> listener) Registers thelistenerto be called when an execution is aborted.RetryPolicyBuilder.onFailedAttempt(EventListener<ExecutionAttemptedEvent<R>> listener) Registers thelistenerto be called when an execution attempt fails.RetryPolicyBuilder.onRetriesExceeded(EventListener<ExecutionCompletedEvent<R>> listener) Registers thelistenerto be called when an execution fails and themax retry attemptsormax durationare exceeded.RetryPolicyBuilder.onRetry(EventListener<ExecutionAttemptedEvent<R>> listener) Registers thelistenerto be called when a retry is about to be attempted.RetryPolicyBuilder.onRetryScheduled(EventListener<ExecutionScheduledEvent<R>> listener) Registers thelistenerto be called when a retry for an async call is about to be scheduled.RetryPolicyBuilder.withBackoff(long delay, long maxDelay, ChronoUnit chronoUnit) Sets thedelaybetween retries, exponentially backing off to themaxDelayand multiplying consecutive delays by a factor of 2.RetryPolicyBuilder.withBackoff(long delay, long maxDelay, ChronoUnit chronoUnit, double delayFactor) Sets thedelaybetween retries, exponentially backing off to themaxDelayand multiplying consecutive delays by thedelayFactor.RetryPolicyBuilder.withBackoff(Duration delay, Duration maxDelay) Sets thedelaybetween retries, exponentially backing off to themaxDelayand multiplying consecutive delays by a factor of 2.RetryPolicyBuilder.withBackoff(Duration delay, Duration maxDelay, double delayFactor) Sets thedelaybetween retries, exponentially backing off to themaxDelayand multiplying consecutive delays by thedelayFactor.RetryPolicyBuilder.withDelay(long delayMin, long delayMax, ChronoUnit chronoUnit) Sets a random delay between thedelayMinanddelayMax(inclusive) to occur between retries.Sets the fixeddelayto occur between retries.Sets a random delay between thedelayMinanddelayMax(inclusive) to occur between retries.RetryPolicyBuilder.withJitter(double jitterFactor) Sets thejitterFactorto randomly vary retry delays by.RetryPolicyBuilder.withJitter(Duration jitter) Sets thejitterto randomly vary retry delays by.RetryPolicyBuilder.withMaxAttempts(int maxAttempts) Sets the max number of execution attempts to perform.RetryPolicyBuilder.withMaxDuration(Duration maxDuration) Sets the max duration to perform retries for, else the execution will be failed.RetryPolicyBuilder.withMaxRetries(int maxRetries) Sets the max number of retries to perform when an execution attempt fails.