thenCombine

public List findPrices(String product) { List priceFutures = shops.stream() .map(shop -> CompletableFuture.supplyAsync(() -> shop.getPrice(product), executor)) .map(future -> future.thenApply(Quote::parse)) .map(future -> future.thenCompose(quote -> CompletableFuture.supplyAsync(() -> Discount.applyDiscount(quote), executor))); return priceFutures.stream() .map(CompletableFuture::join) .coolect(..
깡냉쓰
'thenCombine' 태그의 글 목록