Coroutines for Java Developers
summary
Shows how Kotlin coroutines use the suspend keyword and compiler-generated continuation objects to turn blocking calls into suspensions (example: wrapping a CompletableFuture to resume a continuation), with APIs like launch/async/withContext and Dispatchers for executor mapping. Demonstrates sequences with yield, measures that millions of coroutines start in ~1.5s while OS threads cap at ~4k–12k, and explains structured concurrency that auto-cancels child coroutines; works on JVM (down to Java 6) and powers Ktor.
AI-written summary · about
chapters (13)
- 0:00Start
- 10:35Fibonacci Sequence
- 11:45Coroutine Builder == Sequence
- 12:43Suspend & Fun Rules
- 13:12How does it work?
- 19:58macos / Linux
- 24:33Threads vs Coroutines
- 25:54Example Service
- 28:15Rx Operators
- 33:46Maven/Gradle Dependency
- 35:17Launch Coroutine
- 36:32Switch Dispatcher
- 37:38Structured Concurrency
related talks
47mKotlin Coroutines
40mConcurrency made easy with Kotlin Coroutines
46mIntroduction to Coroutines
45mDeep Dive into Coroutines on JVM
01h 03mUsing Kotlin Coroutines for Asynchronous and Concurrent Programming
42mKotlin Coroutines: Beyond async/await
11mKotlin Coroutines: Design and Implementation
42mKotlin Coroutines: An Intro to Practical Use on Android
