Class FutureExecution<V>
java.lang.Object
io.smallrye.faulttolerance.core.async.FutureExecution<V>
- All Implemented Interfaces:
FaultToleranceStrategy<Future<V>>
Unlike
CompletionStageExecution, this is supposed to be the first strategy
in the chain. The remaining strategies are executed on an extra thread. This allows using
the synchronous strategies to implement Future-based @Asynchronous
invocations, with two exceptions:
- timeouts, where
AsyncTimeoutis needed in front ofTimeout; - bulkheads, where
FutureThreadPoolBulkheadis used instead ofSemaphoreBulkheadsimply because that's what the spec requires.
-
Constructor Summary
ConstructorsConstructorDescriptionFutureExecution(FaultToleranceStrategy<Future<V>> delegate, Executor executor) -
Method Summary
-
Constructor Details
-
FutureExecution
-
-
Method Details
-
apply
Description copied from interface:FaultToleranceStrategyApply the fault tolerance strategy around the targetCallable. TheCallableis wrapped in anInvocationContext.- Specified by:
applyin interfaceFaultToleranceStrategy<V>- Parameters:
ctx- theInvocationContextwrapping theCallableguarded by this fault tolerance strategy- Returns:
- result computed by the target
Callable
-