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);

comments powered by Disqus