~/talk

Mistakes you make using Kotlin Coroutines

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

Lists the concrete pitfalls and fixes: using async with immediate await (no parallelism), wrapping work in a child launch inside coroutineScope (redundant), starting background work on the wrong scope instead of application or ViewModel scope, and misusing GlobalScope. Warns against runBlocking in suspending contexts, shows cancellation traps (Job vs SupervisorJob, supervisorScope vs context+supervisorJob), missing cancellation points—use yield/ensureActive—and forgotten cleanup requires withContext(NonCancellable). Recommends Dispatchers.IO for blocking I/O and Blockhound integration to detect blocking calls.

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Coroutine builder mistakes
  3. 7:37Cancellation problems
  4. 18:39Cancellation exceptions
  5. 20:30Android coroutine pitfalls
  6. 23:20Dispatcher misuse
  7. 26:55Suspend/flow anti-patterns
  8. 28:43Code review contest
~/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.