java中创建Completed future

xkrivzooh2019年2月15日
小于 1 分钟

java中创建Completed future

在Java中如何创建Completed future呢?

Java8中可以Future future = CompletableFuture.completedFuture(value); Guava中可以Futures.immediateFuture(value) Apache commons Lang中可以Future<T> future = ConcurrentUtils.constantFuture(T myValue);

上次编辑于: 2022/9/13 16:52:28
Loading...