Kotlin Coroutines
summary
Explains how Kotlin implements async/await as library functions on top of coroutines, shows suspend functions compiled to a continuation/state‑machine, and demonstrates Deferred vs launch and where work resumes (default thread pool vs main UI thread). Shows lifecycle binding via CoroutineScope and how structured concurrency makes child coroutines cancel automatically, so started coroutines are tied to an activity‑like lifecycle. Counts scale (thousands of lightweight coroutines), concrete APIs used (Deferred, launch, await) and the real cancellation/exception behavior.
AI-written summary · about
chapters (11)
- 0:00Start
- 1:53Motivation
- 3:22No callbacks!
- 7:54Example: waiting for two asynchronous computations to complete
- 10:06Back to image example
- 10:19async starts new computation
- 10:57await is a suspend function
- 19:39Rewrite with suspend functions
- 22:47Coroutine Builder starts a coroutine
- 34:48Activity lifecycle
- 42:18Continuation
related talks
59mKotlin coroutines: new ways to do asynchronous programming
42mKotlin Coroutines: Beyond async/await
49mKotlin Coroutines
30mBetter asynchronous programming with Kotlin Coroutines
43mCoroutines for Java Developers
40mConcurrency made easy with Kotlin Coroutines
46mIntroduction to Coroutines
38mKotlin coroutines
