CompletableFuture is a Future enhancement class provided by JDK8.

  • You can specify Executor implementations that perform asynchronous tasks, such as ForkJoinPool, ExecutorService, and so on

  • If not specified, ForkJoinPool.commonPool() is used by default.

  • If the machine is single-core, the default is ThreadPerTaskExecutor(), which is an internal class that creates a new thread each time execute.

CompletableFuture

Welcome to comment and exchange.