Skip to content

Instantly share code, notes, and snippets.

@jasmine-k
Last active March 26, 2018 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasmine-k/fd3200964cf633eb6a42400ce41cee28 to your computer and use it in GitHub Desktop.
Save jasmine-k/fd3200964cf633eb6a42400ce41cee28 to your computer and use it in GitHub Desktop.
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