Better asynchronous programming with Kotlin Coroutines
summary
Kotlin Coroutines are shown as a practical replacement for callback hell by building a tiny DSL: an extension on LifecycleOwner that returns a Deferred from an async loader and an infix UI extension that calls await on the main thread; automatic cancellation happens via a LifecycleObserver that cancels the job on onStop. The demo uses launch/async, suspend functions, actors to throttle clicks, mentions a Retrofit deferred adapter, and notes coroutines are experimental and require Gradle flags; code is on GitHub and runs.
AI-written summary · about
chapters (8)
- 0:00Start
- 0:09BETTER ASYNC ON ANDROID WITH KOTLIN COROUTINES
- 9:23CONTINUATION?
- 13:01WHAT THREAD TO RUN ON
- 13:38THE FUNCTION TO RUN
- 15:23SUSPENDED FUNCTION
- 20:03LIFECYCLE OBSERVER
- 28:44RETROFIT ADAPTER
related talks
30mBetter asynchronous programming with Kotlin Coroutines
42mKotlin Coroutines: Beyond async/await
47mKotlin Coroutines
59mKotlin coroutines: new ways to do asynchronous programming
42mKotlin Coroutines: An Intro to Practical Use on Android
49mKotlin Coroutines
35mEfficient Async with Kotlin Coroutines
43mAsynchronous programming using Coroutines
