Exploring Coroutines in Kotlin
summary
Kotlin coroutines let code stay sequential while becoming nonblocking: the demo turns blocking URL reads for a localhost stock-price service (port 8085) into concurrent work with launch/async/await, cutting three ~1s serial calls to about one second total. Compiler-desugaring shows a continuation added as second parameter for every suspend function. Examples include sequence/yield continuations and a working stock-price+IP demo; the async version executes correctly and measures the speedup.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:59Parallelism
- 3:55Sleep Function
- 10:44How Does Co-Routines Actually Work
- 19:51Exceptions
- 21:32Report the Exception
- 22:15Catch Exception
- 31:04Sequential Code
- 32:41Responsiveness
- 42:23Synchronous versus Asynchronous
- 43:54Download the Code Examples
related talks
43mCoroutines for Java Developers
33mVisualising concurrency with Kotlin
01h 03mUsing Kotlin Coroutines for Asynchronous and Concurrent Programming
30mBetter asynchronous programming with Kotlin Coroutines
46mIntroduction to Coroutines
40mConcurrency made easy with Kotlin Coroutines
56mKotlin Coroutines And More
47mKotlin Coroutines
