Uses of Interface
dev.failsafe.spi.Scheduler
Packages that use Scheduler
Package
Description
APIs for performing failsafe executions.
The Failsafe Service Provider Interface (SPI).
-
Uses of Scheduler in dev.failsafe
Fields in dev.failsafe declared as SchedulerMethods in dev.failsafe with parameters of type SchedulerModifier and TypeMethodDescription(package private) static <R> Function
<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> Functions.toAsync
(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Returns a Function that asynchronously applies theinnerFn
on the first call, synchronously on subsequent calls, and returns a promise containing the result.Configures thescheduler
to use for performing asynchronous executions and listener callbacks.Constructors in dev.failsafe with parameters of type SchedulerModifierConstructorDescription(package private)
AsyncExecutionImpl
(List<Policy<R>> policies, Scheduler scheduler, FailsafeFuture<R> future, boolean asyncExecution, Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn) (package private)
SyncExecutionImpl
(FailsafeExecutor<R> executor, Scheduler scheduler, CallImpl<R> call, Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn) Create a sync execution for theexecutor
. -
Uses of Scheduler in dev.failsafe.internal
Methods in dev.failsafe.internal with parameters of type SchedulerModifier and TypeMethodDescriptionFallbackExecutor.apply
(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Performs an execution by calling pre-execute else calling the supplier, applying a fallback if it fails, and calling post-execute.RetryPolicyExecutor.apply
(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) TimeoutExecutor.apply
(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Schedules a separate timeout call that fails withTimeoutExceededException
if the policy's timeout is exceeded.FallbackExecutor.applyAsync
(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.RetryPolicyExecutor.applyAsync
(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) TimeoutExecutor.applyAsync
(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Schedules a separate timeout call that blocks and fails withTimeoutExceededException
if the policy's timeout is exceeded.RetryPolicyExecutor.handleAsync
(AsyncExecutionInternal<R> execution, Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, CompletableFuture<ExecutionResult<R>> promise, AtomicReference<ExecutionResult<R>> previousResultRef) RetryPolicyExecutor.onFailureAsync
(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Defaults async executions to not be complete untilsays they are
.protected CompletableFuture
<ExecutionResult<R>> BulkheadExecutor.preExecuteAsync
(Scheduler scheduler, FailsafeFuture<R> future) protected CompletableFuture
<ExecutionResult<R>> RateLimiterExecutor.preExecuteAsync
(Scheduler scheduler, FailsafeFuture<R> future) -
Uses of Scheduler in dev.failsafe.internal.util
Classes in dev.failsafe.internal.util that implement SchedulerModifier and TypeClassDescriptionfinal class
AScheduler
implementation that schedules delays on an internal, common ScheduledExecutorService and executes tasks on either a providedExecutorService
,ForkJoinPool.commonPool()
, or an internalForkJoinPool
instance. -
Uses of Scheduler in dev.failsafe.spi
Fields in dev.failsafe.spi declared as SchedulerModifier and TypeFieldDescriptionstatic final Scheduler
Scheduler.DEFAULT
The default scheduler used by Failsafe if no other scheduler orScheduledExecutorService
is configured for an execution.Methods in dev.failsafe.spi that return SchedulerModifier and TypeMethodDescriptionstatic Scheduler
Scheduler.of
(ExecutorService executorService) Returns a Scheduler adapted from theexecutorService
.static Scheduler
Scheduler.of
(ScheduledExecutorService scheduledExecutorService) Returns a Scheduler adapted from thescheduledExecutorService
.Methods in dev.failsafe.spi with parameters of type SchedulerModifier and TypeMethodDescriptionPolicyExecutor.apply
(Function<SyncExecutionInternal<R>, ExecutionResult<R>> innerFn, Scheduler scheduler) Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.PolicyExecutor.applyAsync
(Function<AsyncExecutionInternal<R>, CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future) Performs an async execution by calling pre-execute else calling the supplier and doing a post-execute.protected CompletableFuture
<ExecutionResult<R>> PolicyExecutor.onFailureAsync
(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Performs potentially asynchrononus post-execution handling for a failedresult
, possibly creating a new result, else returning the originalresult
.protected CompletableFuture
<ExecutionResult<R>> PolicyExecutor.postExecuteAsync
(AsyncExecutionInternal<R> execution, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future) Performs potentially asynchronous post-execution handling for aresult
.protected CompletableFuture
<ExecutionResult<R>> PolicyExecutor.preExecuteAsync
(Scheduler scheduler, FailsafeFuture<R> future) Called before an async execution to return an alternative result or exception such as if execution is not allowed or needed.