Lean Async Code with Kotlin's Coroutines
summary
Explains how to replace callback hell and much RxJava boilerplate with Kotlin coroutines, using kotlinx.coroutines primitives: launch, async/Deferred, runBlocking, and select/await to run parallel geocoding requests, take the first result, or wait for all jobs. Shows using Retrofit for network calls, converting lat/long to addresses in parallel, a lifecycle-bound Job canceller, and a conflated BroadcastChannel pattern turned into a simple DataStore/DataStream abstraction for UI updates. Claims clearer, sequential-looking code and easy custom abstractions.
AI-written summary · about
chapters (7)
- 0:00Introduction to async code
- 2:29What are coroutines
- 6:04Coroutines in practice
- 10:01Parallel task execution
- 12:33Observing changes with channels
- 16:45Why use coroutines
- 19:34Q&A and summary
related talks
30mBetter asynchronous programming with Kotlin Coroutines
43mAsynchronous programming using Coroutines
35mEfficient Async with Kotlin Coroutines
38mKotlin coroutines
38mCoroutines by Example
42mI Swapped RxJava for Coroutines. Why You Should Too
42mKotlin Coroutines: Beyond async/await
32mNetworking the Kotlin way: Retrofit + Coroutines
