Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public CompletionStage<Account> get(Long id) {
- return supplyAsync(() -> wrap(em -> Failsafe.with(circuitBreaker).get(() -> lookup(em, id))));
- }
- var Q = require('q')
- Q.all([ repository.get(id1), repository.get(id2) ])
- .then(result -> {
- console.log(result[0] + ' ' + result[1])
- })
- CompletableFuture<CompletionStage<Account>> first = CompletableFuture.supplyAsync(() -> repository.get(actionActionTuple._1.getAccountId()));
- CompletableFuture<CompletionStage<Account>> second = CompletableFuture.supplyAsync(() -> repository.get(actionActionTuple._2.getAccountId()));
- return CompletableFuture.allOf(first, second)
- .thenAcceptAsync(res -> {
- System.out.println("res = " + res);
- });
Add Comment
Please, Sign In to add comment