A simple app that demonstrates 5 Kotlin Coroutines secrets.
SupervisorJob()
in customCoroutineScope
.NonCancellable
when callingsuspend
functions infinally
block.coroutineContext.ensureActive()
when catching general exception inside a coroutine.- Providing
Dispatchers
instead of harcoding them. - Calling
yield()
in blocking calls inside a coroutine.