CompletableFuture implements Future, CompletableStage. (그래서 CompletableStage공부도 필요)
<CompleteFuture의 기본 함수들>
.complete(returnValue)
.completeExceptionally(exception)
.thenApply (Func) : 결과값에 적용
.thenCompose (Func) : future에 적용? - 이것 자체도 Task가 됨 (333p)
.thenCombine (Func) : A task결과와 B task결과를 이용한 연산가능.
.thenAccept(Consumer)
(static) .supplyAsync ( Supplier<R> ) R:ReturnType
첫번째 stream에서 CompletableFuture<String>의 List를 가지고 있지만,
List<String>을 원한다면 기다린 후, Future들에서 값을 가져와야 하는데, 이 일을 해주는게 join이다.
별도의 stream 루프로 처리해야 Parallel처리가 된다.. 안그러면 supplier->join->supplier->join 순차적처리가 됨.