~/talk

Asynchrony and the infinite conveyor belt: Advanced Coroutines and Flows

Talkat droidcon London 2024 · 2024-10-31..11-01· [android, concurrency]
slides:none on file

Coroutines are tasks that can suspend and cancellation happens only when they yield — cancellation is implemented by cancellation throws CancellationException, so accidentally catching that exception (e.g., wrapping a suspend call in try/catch) can make a loop run forever. Dispatchers available: Main, IO, Default, Unconfined; use withContext or launch into a dispatcher. CoroutineScope is just a context wrapping a Job, which parents/children cancel hierarchically. Flows: cold vs hot, use shareIn with whileSubscribed and replay to avoid duplicate IO, and use stateFlow has .value current state for a single current value.

AI-written summary · about

  1. 0:00Introduction to co-routines and the talk
  2. 1:27What is a coroutine
  3. 5:28Co-routines are tasks that can suspend
  4. 7:33How cancellation works in co-routines
  5. 9:43When cancellation occurs
  6. 12:34Danger of catching cancellation
  7. 14:43Launch vs async differences
  8. 15:46Coroutine scopes purpose
  9. 18:40Understanding dispatchers in co-routines
  10. 20:51Coroutine context metadata
  11. 22:20Jobs as coroutine handles
  12. 23:45Scope vs job explained
  13. 26:16Introduction to flows
  14. 27:18Cold vs hot flows
  15. 28:47Cold to hot flows
  16. 30:59Sharing flows configurations
  17. 32:45State flows and values
  18. 34:36Summary of coroutines and flows
~/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.