Last active
May 29, 2016 13:45
-
-
Save HennIdan/b8a489a18f7f6830bcd3b5ee0cd78be7 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> marvel = executor.submit(new Callable <String> () { | |
public String call() { | |
return getMarvelHeroWithCharacter(“C”); | |
} | |
}); | |
// other stuff goes here | |
marvel.complete(“Mystique”); // sets a “default” value if not yet completed | |
System.out.println(marvel.get()); // non-blocking |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment