~/talk

Tips, Best Practices, and Real-world Insights

Talkat droidcon Berlin 2024 · 2024-07-03..07-05· [kotlin]
links:none on file
slides:none on file

Saving to Room via suspend DAO fails because viewModelScope gets canceled when the screen closes, so writes never finish; use an independent repository scope for persistence while keeping viewModelScope for reads. Name coroutines (example: CoroutineName for debugger filtering like "database updator" vs "remote service updator") to search StandaloneCoroutine objects in the heap and inspect context elements. Add a custom CoroutineContext trace ID to correlate logs across activity → viewmodel → repository. Never use runBlocking on main (or limited thread pools); it deadlocks—prefer reactive patterns, e.g. flows, for config loading.

AI-written summary · about

  1. 0:00Coroutines introduction
  2. 1:05Coroutine scope challenges
  3. 6:09ViewModel scope cancels writes
  4. 9:46Independent write scopes
  5. 10:10Coroutine context elements
  6. 12:19Debugging with names
  7. 14:30Finding coroutines in memory
  8. 17:43Naming coroutines
  9. 18:27Custom logging context
  10. 25:46Underused coroutine context
  11. 26:07Dangers of runBlocking
  12. 27:16runBlocking deadlocks
  13. 30:30runBlocking alternatives
  14. 33:04Summary
~/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.