July 2018
Intermediate to advanced
242 pages
8h 6m
English
The preceding code is going to print the following text to the console:
Running on mainRunning on SushiThreadCurrent thread is not blocked while rice is being cookedStarting to cook rice on ForkJoinPool.commonPool-worker-1Starting to prepare fish on SushiThreadFish preparedStarting to cut vegetables on SushiThreadVegetables readyRice cookedStarting to roll the sushi on SushiThreadSushi rolledTotal time: 12089 ms
In the beginning, we start a new coroutine running on a background thread with the launch() function call. We also create a handle to the Job instance returned by the launch() function under the var sushiCookingJob: Job variable.
Read now
Unlock full access