~/talk

Server-side Kotlin with Coroutines

Talkat GOTO Chicago 2019 · 2019-04-29..04-30· [kotlin]
slides:none on file

Kotlin coroutines replace thousands of blocking threads with a few event threads plus tiny continuations so servers scale by default and require sizing roughly to CPU cores for CPU work and to I/O threads for sockets. Suspend functions compile to callback-style continuations (one small object per suspension), integrate with Reactor/CompletableFuture or Spring 5.2, and use dispatchers to isolate blocking or CPU work. suspend functions enable low-allocation async, structured concurrency prevents leaking child tasks. Flow replaces channels for cold, cancelable streams.

AI-written summary · about

  1. 0:00Introduction
  2. 1:51Old-school client-server monolith
  3. 2:32Sizing threads - easy
  4. 4:08Complex business logic
  5. 5:22What if a service is slow?
  6. 5:40Blocks threads
  7. 7:43Release the thread
  8. 10:47Suspend behind the scenes
  9. 11:42Performance!
  10. 13:43Integration
  11. 14:44Release thread?
  12. 14:58Blocking server
  13. 15:50Asynchronous server
  14. 16:40Server integrated with coroutines
  15. 17:30Server not integrated with coroutines
  16. 19:23Suspend is efficient
  17. 21:14Let's go deeper (with coroutines)
  18. 21:49Call stack with coroutines
  19. 23:26Thread pools
  20. 27:51CPU-bound code
  21. 28:14Fine-grained control and encapsulation
  22. 33:14Concurrency with async (futures)
  23. 35:25Concurrency with coroutines
  24. 38:04Without coroutine scope?
  25. 38:54Convention
  26. 39:41Types as documentation
  27. 40:35Types are enforced
  28. 42:46Green threads / Fibers
  29. 43:25Fibers promise
  30. 44:40Solution - shared thread pool
  31. 45:54Returning many responses
  32. 48:02Where's the catch?
  33. 50:14Flow example
~/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.