November 2017
Intermediate to advanced
398 pages
10h 14m
English
To demonstrate and appreciate the power of CompletableFuture, let's start with a problem implemented using just Future and then see how much more effectively it can be solved with CompletableFuture. Let's imagine that we are tasked with modeling a building that consists of four stages:
In the traditional sequential programming for the single thread, the model would look like this:
StopWatch stopWatch = new StopWatch();Stage failedStage;String SUCCESS = "Success";stopWatch.start();String result11 = doStage(Stage.FoundationMaterials);String result12 = doStage ...
Read now
Unlock full access