Join Slack
Powered by
does runBlocking create a new coroutine scope so t...
# coroutines
b
Bernhard
02/04/2019, 2:12 PM
does runBlocking create a new coroutine scope so that your jobs inside of it won’t leak on exceptions
Bernhard
02/04/2019, 2:42 PM
ok, judging from the example at the bottom
https://kotlinlang.org/docs/reference/coroutines/composing-suspending-functions.html#structured-concurrency-with-async
it seems that creating a scope is still necessary
g
gildor
02/04/2019, 3:37 PM
runBlocking provides own scope, so create additional scope is not necessary
gildor
02/04/2019, 3:38 PM
All examples from this section create scope because start coroutine from suspend function
gildor
02/04/2019, 3:39 PM
In case of error runBlocking will cancel child coroutines and throw an exception
b
Bernhard
02/04/2019, 6:41 PM
thank you!
4
Views
Open in Slack
Previous
Next