类 FutureUtils
java.lang.Object
cn.taketoday.util.concurrent.FutureUtils
Convenience utilities for working with
Future
and implementations.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Harry Yang
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <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.private static <T> Supplier<T>toSupplier(Callable<T> callable, CompletableFuture<T> result)
-
构造器详细资料
-
FutureUtils
public FutureUtils()
-
-
方法详细资料
-
callAsync
Return a newCompletableFuturethat is asynchronously completed by a task running in theForkJoinPool.commonPool()with the value obtained by calling the givenCallable.- 参数:
callable- a function that returns the value to be used, or throws an exception- 返回:
- the new CompletableFuture
- 另请参阅:
-
callAsync
Return a newCompletableFuturethat is asynchronously completed by a task running in the given executor with the value obtained by calling the givenCallable.- 参数:
callable- a function that returns the value to be used, or throws an exceptionexecutor- the executor to use for asynchronous execution- 返回:
- the new CompletableFuture
- 另请参阅:
-
toSupplier
-