Class FutureExecution<V>
- java.lang.Object
-
- io.smallrye.faulttolerance.core.async.FutureExecution<V>
-
- All Implemented Interfaces:
FaultToleranceStrategy<Future<V>>
public class FutureExecution<V> extends Object implements FaultToleranceStrategy<Future<V>>
UnlikeCompletionStageExecution, 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 implementFuture-based@Asynchronousinvocations, 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
Constructors Constructor Description FutureExecution(FaultToleranceStrategy<Future<V>> delegate, Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<V>apply(InvocationContext<Future<V>> ctx)Apply the fault tolerance strategy around the targetCallable.
-
-
-
Constructor Detail
-
FutureExecution
public FutureExecution(FaultToleranceStrategy<Future<V>> delegate, Executor executor)
-
-
Method Detail
-
apply
public Future<V> apply(InvocationContext<Future<V>> ctx)
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
-
-