Coroutines Case Study - Cleaning Up an Async API
summary
Claims a working Kotlin extension that turns a void callback USB card‑reader SDK into clean suspend APIs, using suspend wrapper on top of void callback API and channels + select to await event or error. It uses async/await, supervisor jobs and coroutineScope for structured concurrency, debug probes for tracing, and sealed result types instead of exceptions. The result is readable sequential code, easier testing and recoverable error cases for unreliable hardware.
AI-written summary · about
chapters (12)
- 0:00COROUTINES CASE
- 1:09Tom Hanley
- 2:19Launch vs Async
- 2:55Toast Restaurant Platform
- 5:13The Card Reader API
- 9:18API Extension Goals
- 14:17Sequence Diagram
- 15:46Structured Concurrency
- 20:29Enable Debug Mode
- 21:32Use the Debug Agent
- 22:49Debug Agent JUnit Rule
- 27:23Whats the problem with exceptions for error handling?
related talks
59mKotlin coroutines: new ways to do asynchronous programming
42mKotlin Coroutines: Beyond async/await
40mBuilding Asynchronous Mechanisms in Android App, Using Kotlin Coroutines
42mKotlin Coroutines: An Intro to Practical Use on Android
30mBetter asynchronous programming with Kotlin Coroutines
38mKotlin coroutines
34mMaking any codebase more readable with Kotlin coroutines
29mTrip into the async world
