louiscad
04/20/2018, 3:59 PMThe default dispatcher for runBlocking coroutine, in particular, is confined to the invoker threadIs this still true? Isn't
runBlocking
now using DefaultDispatcher
, which is equal to CommonPool
on JVM/Android?
Quote from here, second paragraph, third sentence: https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#unconfined-vs-confined-dispatcherpetersommerhoff
04/21/2018, 11:30 AMrunBlocking
, its default context is actually EmptyCoroutineContext
so no dispatcher at all AFAICT, so works like Unconfined I guess. That's also why runBlocking keeps running in the main thread and not on something like a ForkJoinPool worker