Kotlin coroutines: new ways to do asynchronous programming
summary
Kotlin provides async/await as library functions plus language-level suspend functions that let calls suspend without returning Deferred everywhere; async/await still exists as Deferred. Builders like async and launch run coroutines on dispatchers you choose; coroutine scopes enforce structured concurrency so a failing child cancels siblings automatically. Channels (rendezvous, buffered, conflated) use suspend send/receive for producer/consumer patterns and automatic load balancing. Overhead is a small heap-stored call stack per coroutine, not OS threads.
AI-written summary · about
chapters (16)
- 0:00Intro
- 2:50async and await are functions defined in the standard library
- 4:07Example: simple consecutive logic
- 6:28Rewrite with suspend functions
- 14:20Coroutine builders
- 15:22Simple "load image" example
- 15:49async creates a new coroutine: starts a new asynchronous computation
- 20:26Call stack of a coroutine
- 24:12Specify the context
- 26:06Structural concurrency
- 27:28Two asynchronous coroutines
- 28:54Problem: leaking coroutine
- 30:59Enforcing structure
- 38:19Types of Channels
- 39:50"Rendezvous" channel semantics
- 52:34Suspended coroutine
related talks
42mKotlin Coroutines: Beyond async/await
49mKotlin Coroutines
47mKotlin Coroutines
30mBetter asynchronous programming with Kotlin Coroutines
01h 03mUsing Kotlin Coroutines for Asynchronous and Concurrent Programming
45mCoroutines: Kotlin Versus
11mKotlin Coroutines: Design and Implementation
42mKotlin Coroutines: An Intro to Practical Use on Android
