Class FutureUtils
java.lang.Object
org.springframework.util.concurrent.FutureUtils
Convenience utilities for working with 
Future
 and implementations.- Since:
- 6.0
- Author:
- Arjen Poutsma
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> CompletableFuture<T>Return a newCompletableFuturethat is asynchronously completed by a task running in theForkJoinPool.commonPool()with the value obtained by calling the givenCallable.static <T> CompletableFuture<T>Return a newCompletableFuturethat is asynchronously completed by a task running in the given executor with the value obtained by calling the givenCallable.
- 
Constructor Details- 
FutureUtilspublic FutureUtils()
 
- 
- 
Method Details- 
callAsyncReturn a newCompletableFuturethat is asynchronously completed by a task running in theForkJoinPool.commonPool()with the value obtained by calling the givenCallable.- Parameters:
- callable- a function that returns the value to be used, or throws an exception
- Returns:
- the new CompletableFuture
- See Also:
 
- 
callAsyncReturn a newCompletableFuturethat is asynchronously completed by a task running in the given executor with the value obtained by calling the givenCallable.- Parameters:
- callable- a function that returns the value to be used, or throws an exception
- executor- the executor to use for asynchronous execution
- Returns:
- the new CompletableFuture
- See Also:
 
 
-