~/talk

Kotlin Coroutines: An Intro to Practical Use on Android

Talkat 360|AnDev 2018 · 2018-07-19..07-20· [kotlin]
speakerdeck:nickcapurso
slides:none on file

Coroutines claim to replace callbacks and RxJava for Android by giving sequential-looking async code while actually supporting suspend functions, launch/async/deferred builders and withContext thread switches. Examples show cancellation via Job and cooperative cancellation (delay vs Thread.sleep), parallelism with async/await, dispatchers (commonPool defaults to cpu count) and Retrofit deferred adapters. Unit tests use runBlocking to run suspending code. Several production uses report success and the talk demonstrates concrete code patterns, gotchas, and testing strategies.

AI-written summary · about

  1. 0:00Intro
  2. 1:34Outline
  3. 4:55Take an example... with callbacks
  4. 7:21What is a coroutine?
  5. 11:42What are Kotlin Coroutines?
  6. 17:47Coroutine Builders - async
  7. 20:21Coroutine Builders - runBlocking
  8. 21:53Using Thread Pools
  9. 24:23A note about threading...
  10. 28:18Switching Threads in a Coroutine
  11. 28:41Cancelling Coroutines
  12. 33:04Error Handling
  13. 34:09Testing
  14. 36:46Tips for starting in an existing app
  15. 38:30A Note on "Experimental" Status
  16. 41:12Any Questions?
~/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.