jordigarcl
06/22/2020, 1:09 PMlaunch a single coroutine in a runBlocking scope?
Example
fun foo() {
runBlocking {
launch {
// some suspend functions
}
}
}
Instead of
fun foo() {
runBlocking {
// some suspend functions
}
}streetsofboston
06/22/2020, 1:14 PMjordigarcl
06/22/2020, 1:16 PMlaunch though?andylamax
06/22/2020, 1:59 PMlaunch.elizarov
06/22/2020, 2:54 PMlaunch inside runBlocking should be totally transparent.andylamax
06/22/2020, 2:55 PMstreetsofboston
06/22/2020, 2:58 PMrunBlocking with j*ust* a single launch is totally transparent, but it could still have one launch and some other code, which then would happen in parallel. 🙂
runBlocking {
launch { .... }
here()
is()
someOtherCode()
}