Sho SHIMIZU
Committed by Gerrit Code Review

Refactor: Decompose creating CompletableFuture and process intent

Change-Id: I09de2965b7fbf593c1baf3b2e95ab15437f9a092
...@@ -325,8 +325,9 @@ public class IntentManager ...@@ -325,8 +325,9 @@ 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(x -> createInitialPhase(x)) 328 + .map(IntentManager.this::createInitialPhase)
329 - .map(x -> CompletableFuture.supplyAsync(() -> process(x), workerExecutor)) 329 + .map(CompletableFuture::completedFuture)
330 + .map(x -> x.thenApplyAsync(IntentManager.this::process, workerExecutor))
330 .map(x -> x.thenApply(FinalIntentProcessPhase::data)) 331 .map(x -> x.thenApply(FinalIntentProcessPhase::data))
331 .map(x -> x.exceptionally(e -> { 332 .map(x -> x.exceptionally(e -> {
332 //FIXME 333 //FIXME
......