Skip to content

Instantly share code, notes, and snippets.

Created April 26, 2020 09:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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