completablefuture join vs get
違いは何であるCompletableFuture.get()とはCompletableFuture.join()? 以下は私のコードです: List<String> process() { List<String> messages = Arrays.asList("Msg1", "Msg2", "Msg3", "Msg4", "Msg5", "Msg6", "Msg7", "Msg8", "Msg9", "Msg10", "Msg11", "Msg12"); MessageService messageService = new MessageService(); ExecutorService executor = Executors.newFixedThreadPool(4); List<String> mapResult = new ArrayList<>(); CompletableFuture<?>[] fanoutRequestList = new CompletableFuture[messages.size()]; int count = 0; for (String msg : messages) { CompletableFuture<?> …