Skip to content

Instantly share code, notes, and snippets.

@vichu
Created May 11, 2018 03:31
Show Gist options
  • Save vichu/3e8d73c2531a03c1e8c841043639105c to your computer and use it in GitHub Desktop.
Save vichu/3e8d73c2531a03c1e8c841043639105c to your computer and use it in GitHub Desktop.
access the completable future
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