All the Pitfalls of Coroutines
summary
Covers Kotlin coroutines in Android apps: reviews coroutine basics and correct usage, explains what it means to break structured concurrency, and walks through common and advanced coroutine mistakes that can cause hard-to-debug production issues so developers can detect and avoid them.
AI-written summary · about
chapters (27)
- 0:00Coroutine pitfalls intro
- 2:28Read coroutine docs
- 3:52Coroutines vs callbacks
- 6:00Coroutine definition
- 9:09runBlocking trap on mobile
- 9:30Structured concurrency
- 12:56Structured concurrency example
- 15:03Coroutine internals
- 18:13Error handling
- 20:17Never ignore CancellationException
- 22:49Correct try-catch order
- 23:52Infinite loops with await
- 25:59Breaking structured concurrency
- 27:44Scope misuse
- 28:28Don't implement CoroutineScope
- 29:54Non-cancellable functions danger
- 30:35Unreferenced coroutine scopes
- 31:38MediaPlayer memory leak
- 34:06Long scopes like LifecycleScope
- 35:08Avoid dispatcher blocking
- 37:57Common dispatcher errors
- 38:17Missing suspend API
- 40:44Errors in callbacks
- 41:28Delays during sleep
- 42:09Large file transfers
- 43:34Best practices recap
- 43:56Q&A
related talks
42mKotlin Coroutines: An Intro to Practical Use on Android
37mCoroutines! Gotta catch 'em all!
15m5 Common Traps You Can Step Into When Using Coroutines
43mTough Questions About Kotlin Coroutines
44mTesting Kotlin Coroutines
40mBuilding Asynchronous Mechanisms in Android App, Using Kotlin Coroutines
46mIntroduction to Coroutines
47mFew Tools: How To Write And Understand! Coroutines Tests
