supplyAsync

The CompletableFuture method that starts a task producing a value on another thread and returns a future for it.

In more detail

Without an executor argument it runs on the common pool, which suits short computations but not blocking I/O. Pass your own executor for work that waits on a database or network.

Example

CompletableFuture.supplyAsync(() -> "ready")

Related terms

Taught in

References