September 2019
Intermediate to advanced
462 pages
11h 3m
English
The call to the launch() and runBlocking() functions resulted in the coroutines executing in the same thread as the caller’s coroutine scope. That’s the default behavior of these functions, since they carry a coroutine context from their scope. You may, however, vary the context and the thread of execution of the coroutines where you like.
You may pass a CoroutineContext to the launch() and runBlocking() functions to set the execution context of the coroutines these functions start.
The value of Dispatchers.Default for the argument of type CoroutineContext instructs the coroutine that is started to execute in a thread from a DefaultDispatcher pool. The number of threads in this pool ...
Read now
Unlock full access