Uses of Interface
dev.failsafe.spi.Scheduler
-
Packages that use Scheduler Package Description dev.failsafe APIs for performing failsafe executions.dev.failsafe.internal dev.failsafe.internal.util dev.failsafe.spi The Failsafe Service Provider Interface (SPI). -
-
Uses of Scheduler in dev.failsafe
Fields in dev.failsafe declared as Scheduler Modifier and Type Field Description private Scheduler
FailsafeExecutor. scheduler
Methods in dev.failsafe with parameters of type Scheduler Modifier and Type Method Description (package private) static <R> java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>
Functions. toAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.FailsafeExecutor<R>
FailsafeExecutor. with(Scheduler scheduler)
Configures thescheduler
to use for performing asynchronous executions and listener callbacks.Constructors in dev.failsafe with parameters of type Scheduler Constructor Description AsyncExecutionImpl(java.util.List<Policy<R>> policies, Scheduler scheduler, FailsafeFuture<R> future, boolean asyncExecution, java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn)
SyncExecutionImpl(FailsafeExecutor<R> executor, Scheduler scheduler, CallImpl<R> call, java.util.function.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 Scheduler Modifier and Type Method Description java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>
FallbackExecutor. apply(java.util.function.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.java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>
RetryPolicyExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)
java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>
TimeoutExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)
Schedules a separate timeout call that fails withTimeoutExceededException
if the policy's timeout is exceeded.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>
FallbackExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>
RetryPolicyExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future)
java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>
TimeoutExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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.java.lang.Object
RetryPolicyExecutor. handleAsync(AsyncExecutionInternal<R> execution, java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>> innerFn, Scheduler scheduler, FailsafeFuture<R> future, java.util.concurrent.CompletableFuture<ExecutionResult<R>> promise, java.util.concurrent.atomic.AtomicReference<ExecutionResult<R>> previousResultRef)
java.util.concurrent.CompletableFuture<ExecutionResult<R>>
RetryPolicyExecutor. onFailureAsync(ExecutionContext<R> context, ExecutionResult<R> result, Scheduler scheduler, FailsafeFuture<R> future)
Defaults async executions to not be complete untilsays they are
.protected java.util.concurrent.CompletableFuture<ExecutionResult<R>>
BulkheadExecutor. preExecuteAsync(Scheduler scheduler, FailsafeFuture<R> future)
protected java.util.concurrent.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 Scheduler Modifier and Type Class Description class
DelegatingScheduler
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 Scheduler Modifier and Type Field Description static 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 Scheduler Modifier and Type Method Description static Scheduler
Scheduler. of(java.util.concurrent.ExecutorService executorService)
Returns a Scheduler adapted from theexecutorService
.static Scheduler
Scheduler. of(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
Returns a Scheduler adapted from thescheduledExecutorService
.Methods in dev.failsafe.spi with parameters of type Scheduler Modifier and Type Method Description java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>>
PolicyExecutor. apply(java.util.function.Function<SyncExecutionInternal<R>,ExecutionResult<R>> innerFn, Scheduler scheduler)
Performs an execution by calling pre-execute else calling the supplier and doing a post-execute.java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.CompletableFuture<ExecutionResult<R>>>
PolicyExecutor. applyAsync(java.util.function.Function<AsyncExecutionInternal<R>,java.util.concurrent.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 java.util.concurrent.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 java.util.concurrent.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 java.util.concurrent.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.
-