Skip to content

Instantly share code, notes, and snippets.

@jasmine-k
Last active Mar 26, 2018
Embed
What would you like to do?
private static void allOf() {
CompletableFuture<String> completableFuture1
= CompletableFuture.supplyAsync(() -> "Hello");
CompletableFuture<String> completableFuture2
= CompletableFuture.supplyAsync(() -> "Knolders!");
CompletableFuture<String> completableFuture3
= CompletableFuture.supplyAsync(() -> "Its allOf");
CompletableFuture<Void> combinedFuture
= CompletableFuture.allOf(completableFuture1, completableFuture2, completableFuture3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment