Created
May 11, 2018 03:31
-
-
Save vichu/3e8d73c2531a03c1e8c841043639105c to your computer and use it in GitHub Desktop.
access the completable future
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
try { | |
Map<String, Object> myObjectMap = myObjectCompletableFuture.get(2, TimeUnit.SECONDS); | |
myObjectMap.entrySet().forEach(stringObjectEntry -> System.out | |
.println(stringObjectEntry.getKey() + " = " + stringObjectEntry.getValue().toString())); | |
} catch (InterruptedException | ExecutionException | TimeoutException e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment