~/talk

Coroutines for Kotlin Multiplatform in practise

Talkat droidcon Berlin 2021 · 2021-10-20..10-22· [kotlin, concurrency]
slides:none on file

Kotlin Multiplatform coroutines work, but only if code assumes the Kotlin/Native constraints: kotlinx.coroutines ships as JVM core vs native‑mt (Ktor forces native‑mt), default dispatchers on Native can be single‑threaded and there is no common IO dispatcher, so always inject dispatchers and test the “all dispatchers on one thread” case. Freeze mutable objects or use atomicfu/AtomicRef and freeze public API early. Expose suspend as completion handlers or convert flows to Combine publishers and manually propagate errors and cancellations; async/await on Swift is still main‑thread limited.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:06Coroutines in multiplatform overview
  3. 2:53Coroutines library choices
  4. 4:16Dispatchers in shared code
  5. 7:51Testing coroutines in common code
  6. 9:58Kotlin Native memory model
  7. 14:11Dangers of runBlocking
  8. 18:22Coroutines on iOS basics
  9. 22:34Exception handling in iOS
  10. 23:38Consuming Kotlin Flows in Swift
  11. 28:54Flows to Combine Publishers
  12. 36:35Async/await in Kotlin Multiplatform
  13. 39:48Summary and key 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.