MB_Coder Newsletter

Share this post

When to use coroutineScope vs supervisorScope in Kotlin?

martinbaraya.substack.com

When to use coroutineScope vs supervisorScope in Kotlin?

Kotlin coroutineScope vs supervisorScope

Martin Baraya
Oct 5, 2022
Share this post

When to use coroutineScope vs supervisorScope in Kotlin?

martinbaraya.substack.com

Use coroutineScope

If you launch a coroutine in a coroutineScope, it indicates that if even one of the coroutines fails, the entire scope and all of its child coroutines will be canceled.

Use supervisorScope

When one of the children fails, the scope and all of its children do not fail.

Thanks for reading MB_Coder Newsletter! Subscribe for free to receive new posts and support my work.

Share this post

When to use coroutineScope vs supervisorScope in Kotlin?

martinbaraya.substack.com
Comments
TopNew

No posts

Ready for more?

© 2023 Martin Baraya
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing