Menu

Your SupervisorJob Isn't Protecting What You Think It Is
πŸ“°

Your SupervisorJob Isn't Protecting What You Think It Is

DEV Community: androidΒ·YADNYESH RANAΒ·about 20 hours ago
#MTwBQOVE
#devtoandroid#devto#dev#supervisorjob#flushanalytics
Reading 0:00
15s threshold

Your SupervisorJob isn't protecting what you think it is.

The structured-concurrency pitch for SupervisorJob is simple: "a child's failure

doesn't cancel its siblings." Teams building a shared Kotlin Multiplatform module β€”

one ViewModel -equivalent class whose CoroutineScope backs both the Android screen

and the iOS view model via a Swift bridge β€” lean on exactly that promise to keep one

flaky network call from taking down every other in-flight operation.

It works right up until one of those "isolated" children does something extremely

common: opens its own coroutineScope { } inside itself to run two sub-tasks

concurrently.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.