~/talk

Coroutines, Flow & Android- The Good Parts

Talkat droidcon New York 2023 · 2023-09-14..09-15· [android]
links:none on file
links:none on file
slides:none on file

Concrete rules and gotchas: avoid no heap allocated coroutine scope references because storing a scope (transaction.executeIn example) silently drops launched work; don’t use GlobalScope or MainScope for presenters; prefer use suspend functions over firing non-suspending APIs (trash‑can concurrency) so callers get results and control; prefer StateFlow over SharedFlow for shared state (synchronous value via value, bootstrap with a suspending init), and use lifecycle/compose helpers or channels to manage scope lifetime and avoid leaks.

AI-written summary · about

  1. 0:00Introduction
  2. 2:09Structure concurrency basics
  3. 8:06Heap allocated scope risks
  4. 10:15Dos and don'ts for scopes
  5. 13:05Avoid global scope
  6. 17:38Trash can concurrency
  7. 20:04Flows and cooperation
  8. 24:56What is a flow
  9. 27:00Root coroutines
  10. 30:54Sharing state between coroutines
  11. 34:24Why avoid SharedFlow
  12. 35:07StateFlow superpowers
  13. 36:33StateFlow pitfalls
  14. 39:03Bootstrapping state
  15. 41:33Leaking collections
  16. 42:37StateFlow transforms
  17. 44:02Summary and Q&A
~/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.