Created
November 27, 2017 15:06
-
-
Save babjo/c37631feb9e3ce665315a9f059f93c95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CompletableFuture<String> future1 | |
= CompletableFuture.supplyAsync(() -> "Hello"); | |
CompletableFuture<String> future2 | |
= CompletableFuture.supplyAsync(() -> "Beautiful"); | |
CompletableFuture<String> future3 | |
= CompletableFuture.supplyAsync(() -> "World"); | |
CompletableFuture<Void> combinedFuture | |
= CompletableFuture.allOf(future1, future2, future3); | |
// ... | |
combinedFuture.get(); | |
assertTrue(future1.isDone()); | |
assertTrue(future2.isDone()); | |
assertTrue(future3.isDone()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment