~/talk

Coroutines! Gotta catch 'em all!

Talkat KotlinConf 2019 · 2019-12-04..12-06· [kotlin, testing]
slides:none on file

Explains exactly how Kotlin coroutines fail and how to make them behave: structured concurrency scopes determine whether a child exception cancels siblings, use supervisor job or supervisorScope to isolate failures, use cooperative checks like isActive, yield or ensureActive for cancellation, convert callbacks with suspendCancellableCoroutine so network calls cancel, run cleanup inside withContext(NonCancellable), prefer lifecycle/viewModel scopes (they use supervisor jobs), and install a CoroutineExceptionHandler for uncaught errors so the app doesn’t unexpectedly die.

AI-written summary · about

  1. 0:00Start
  2. 12:16CPU heavy computation that may exhaust thread-pool
  3. 18:08Handling Cancellation
  4. 20:27Cancellation of coroutine code needs to be cooperative!
  5. 20:51Understanding Exceptions
  6. 21:15The failure of a Job cancels the parent Job & other siblings
  7. 24:39The same happens with the coroutine scope builders: coroutineScope and supervisor Scope
  8. 27:27Check the implementation of predefined scopes!
  9. 35:46Supervisor Job to avoid propagating cancellation
~/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.