thenAccept

· Java
앞서 Future와 CompletableFuture를 활용해 비동기 작업 처리를 해보았다. 이를 이용해 비동기 작업 파이프라인 만드는 법을 살펴보자. 동기 작업과 비동기 작업 조합하기 만약 음식을 요리하고 완성된 후 접시에 담는다고 가정해보자. List foodNames = List.of("피자", "햄거버", "파스타", "김밥", "떡볶이"); ExecutorService executor = Executors.newFixedThreadPool(Math.min(foodNames.size(), 100), runnable -> { Thread t = new Thread(runnable); t.setDaemon(true); return t; }); List dishFutures = foodNames.stre..
beekei
'thenAccept' 태그의 글 목록