1 min read

CompletableFutures: A Primer

CompletableFutures are constructs in Java that are very useful for writing clean, concurrent code. Most of the methods around CompletableFutures return stages, which represent asynchronous tasks that can trigger other stages, or return values in the future.

Three of the most useful methods in CompletableFutures are:

It’s easy to mix up thenCompose and thenApply. This thread on StackOverflow helps to shed some light on the differences.

← All posts