android-interview-questions
android-interview-questions copied to clipboard
If 2 task is running then 1 task crash how to avoid other task to crash
Task in question is a Coroutine
Assuming both tasks are running inside of a coroutine, we can pass a supervisor job rather than a default job so that when a child fails, the other children are not impacted
https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-supervisor-job.html