~/talk

Making any codebase more readable with Kotlin coroutines

Talkat Android Makers 2019 · on Tuesday, 2019-04-23· [kotlin]
slides:none on file

Kotlin coroutines turn blocking I/O and callback-heavy code into straightforward suspending functions using kotlinx.coroutines with lifecycle scopes, dispatchers (Main, Default, IO) and structured concurrency. Examples show an 800+ line camera sample and a 1,000+ line Java version collapse to far fewer lines, and recording video in under five lines. Libraries bridge messy APIs (Bluetooth, Retrofit) via suspend wrappers; cancellation, timeouts and backpressure with flows/channels are demonstrated and shown to work in real Android use.

AI-written summary · about

  1. 0:00Intro
  2. 1:34A readability (bad) example
  3. 4:02Thread offloading was inconvenient
  4. 4:31I had to use Bluetooth Low Energy
  5. 5:09I had to use Camera 2 API for video
  6. 6:22My code is often waiting
  7. 7:11Functions signatures
  8. 10:30Non blocking functions: keywords
  9. 12:34Writing your own composition
  10. 13:25Writing your own: parallel composition
  11. 14:36Writing your own: wrapping blocking code
  12. 15:29Dispatchers
  13. 16:27Cancellation != crash
  14. 16:43Cancelling a coroutine
  15. 16:59Cancel after timeout
  16. 17:43Writing your own wrapping simple callbacks
  17. 18:44Writing your own: wrapping callbacks
  18. 19:57Callback hell APIs: safe weapons
  19. 22:51Structured concurrency
  20. 23:53What about streams?
  21. 24:55Built into the language
  22. 26:21Continuation
  23. 28:29Roman Elizarov
  24. 29:22Growing libraries ecosystem
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.