~/talk

A deep dive on the lifecycle-aware coroutines APIs

Talkat droidcon London 2025 · 2025-10-30..10-31· [android, concurrency]
slides:none on file

Shows when UI should stop collecting (maps location example) and which lifecycle APIs actually stop work: repeatOnLifecycle, flowWithLifecycle, collectAsStateWithLifecycle. Dissects implementations: repeatOnLifecycle uses suspendCancellableCoroutine, flowWithLifecycle is built on callbackFlow, collectAsStateWithLifecycle wraps produceState; warns cold flows backed by Channel/buffers or hidden buffering (flowOn) can keep producers active and waste resources. Notes KMP compatibility caveat and an API regret: the atRepeatingJob helper breaks structured concurrency and was discarded.

AI-written summary · about

  1. 0:00Introduction
  2. 5:00Why lifecycle collection matters
  3. 7:23Manual collection pitfalls
  4. 8:05APIs overview
  5. 9:09How repeatOnLifecycle works
  6. 15:13Implementation details
  7. 21:35Using callbackFlow
  8. 24:02How collectAsState works
  9. 26:29Designing good APIs
  10. 27:31Pitfalls of atRepeatingJob
  11. 28:54Key takeaways
~/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.