Class details

The CompleteableFuture<T> class has one internal class that marks asynchronous tasks:

    public static interface     CompletableFuture.AsynchronousCompletionTask

The constructor for the CompleteableFuture<T> class has to be in sync with the provided constructor signature, and it takes no arguments. The class has the following methods organized by what they return.

Returns a CompletionStage:

  • public CompletableFuture<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action)
  • public CompletableFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action)
  • public CompletableFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor) ...

Get Java 9: Building Robust Modular Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.