~/talk

Kotlin coroutines: new ways to do asynchronous programming

Talkat NDC Oslo 2019 · 2019-06-17..06-21· [kotlin]
slides:none on file

Kotlin provides async/await as library functions plus language-level suspend functions that let calls suspend without returning Deferred everywhere; async/await still exists as Deferred. Builders like async and launch run coroutines on dispatchers you choose; coroutine scopes enforce structured concurrency so a failing child cancels siblings automatically. Channels (rendezvous, buffered, conflated) use suspend send/receive for producer/consumer patterns and automatic load balancing. Overhead is a small heap-stored call stack per coroutine, not OS threads.

AI-written summary · about

  1. 0:00Intro
  2. 2:50async and await are functions defined in the standard library
  3. 4:07Example: simple consecutive logic
  4. 6:28Rewrite with suspend functions
  5. 14:20Coroutine builders
  6. 15:22Simple "load image" example
  7. 15:49async creates a new coroutine: starts a new asynchronous computation
  8. 20:26Call stack of a coroutine
  9. 24:12Specify the context
  10. 26:06Structural concurrency
  11. 27:28Two asynchronous coroutines
  12. 28:54Problem: leaking coroutine
  13. 30:59Enforcing structure
  14. 38:19Types of Channels
  15. 39:50"Rendezvous" channel semantics
  16. 52:34Suspended coroutine
~/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.