Package | Description |
---|---|
dev.failsafe |
APIs for performing failsafe executions.
|
dev.failsafe.spi |
The Failsafe Service Provider Interface (SPI).
|
Modifier and Type | Method and Description |
---|---|
FailsafeExecutor<R> |
FailsafeExecutor.with(Scheduler scheduler)
Configures the
scheduler to use for performing asynchronous executions and listener callbacks. |
Modifier and Type | Field and Description |
---|---|
static Scheduler |
Scheduler.DEFAULT
The default scheduler used by Failsafe if no other scheduler or
ScheduledExecutorService is configured for
an execution. |
Modifier and Type | Method and Description |
---|---|
static Scheduler |
Scheduler.of(ExecutorService executorService)
Returns a Scheduler adapted from the
executorService . |
static Scheduler |
Scheduler.of(ScheduledExecutorService scheduledExecutorService)
Returns a Scheduler adapted from the
scheduledExecutorService . |
Modifier and Type | Method and Description |
---|---|
Function<SyncExecutionInternal<R>,ExecutionResult<R>> |
PolicyExecutor.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.
|
Function<AsyncExecutionInternal<R>,CompletableFuture<ExecutionResult<R>>> |
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 failed
result , possibly creating a new
result, else returning the original result . |
protected CompletableFuture<ExecutionResult<R>> |
PolicyExecutor.postExecuteAsync(AsyncExecutionInternal<R> execution,
ExecutionResult<R> result,
Scheduler scheduler,
FailsafeFuture<R> future)
Performs potentially asynchronous post-execution handling for a
result . |
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.
|
Copyright © 2022. All rights reserved.