Sho SHIMIZU
Committed by Gerrit Code Review

Refactor: Generate CompletableFuture first, then process it

Change-Id: I1ef5961a863b855ce2687fcbacd2159c77cb64ce
...@@ -325,8 +325,8 @@ public class IntentManager ...@@ -325,8 +325,8 @@ public class IntentManager
325 (we can also try to update these individually) 325 (we can also try to update these individually)
326 */ 326 */
327 List<CompletableFuture<IntentData>> futures = operations.stream() 327 List<CompletableFuture<IntentData>> futures = operations.stream()
328 - .map(IntentManager.this::createInitialPhase)
329 .map(CompletableFuture::completedFuture) 328 .map(CompletableFuture::completedFuture)
329 + .map(x -> x.thenApply(IntentManager.this::createInitialPhase))
330 .map(x -> x.thenApplyAsync(IntentManager.this::process, workerExecutor)) 330 .map(x -> x.thenApplyAsync(IntentManager.this::process, workerExecutor))
331 .map(x -> x.thenApply(FinalIntentProcessPhase::data)) 331 .map(x -> x.thenApply(FinalIntentProcessPhase::data))
332 .map(x -> x.exceptionally(e -> { 332 .map(x -> x.exceptionally(e -> {
......