https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Albert

08/31/2018, 8:03 AM
When you have something like this:
Copy code
val dispatcher = Executors.newFixedThreadPool(64).asCoroutineDispatcher()

runBlocking(dispatcher) {
    launch {
        // do something
    }
}
I thought
launch
in the example would automatically inherit the
dispatcher
, but I see
launch
uses the
CommonPool
if it is implemented like this. Is there a way that this automatically inherits the parents dispatcher or should it always be used like this
launch(coroutineContext)
?
e

elizarov

08/31/2018, 9:33 AM
👍 3
2 Views