Created
April 26, 2020 09:51
-
-
Save john-nash-rs/0bad524ab25c40aa1ef47977a4663a93 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
private static void demoThenRun() { | |
CompletableFuture<String> completableFuture = CompletableFuture.supplyAsync(() -> { | |
System.out.println("Task Running inside completable Future"); | |
return "returned result"; | |
}); | |
CompletableFuture<Void> secondCompletableFuture = completableFuture.thenRun(() -> { | |
System.out.println("I don't get any input from the previous completableFuture. I am just triggered after it."); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment