~/talk

Testing Kotlin Coroutines

Talkat 4Developers 2022 Online · 2022-04-04..04-07· [testing, kotlin]
slides:none on file

Shows concrete patterns for Android and backend: convert blocking calls by adding suspend and wrapping callbacks with suspendCancellableCoroutine, offload blocking work with withContext(Dispatchers.IO) (default IO pool 64 threads), create scopes with SupervisorJob and exception handlers, limit concurrency with flow flatMapMerge, use supervisorScope vs coroutineScope for failure isolation. Tests use runTest virtual time so delays advance instantly and allow precise assertions that parallel async halves runtime and sequential doubles it.

AI-written summary · about

  1. 0:00Introduction
  2. 9:50Practical use cases
  3. 11:20Migrating to Coroutines
  4. 13:10Application Layers
  5. 14:05Data Layer
  6. 17:40Dispatchers IO
  7. 20:35Dispatchers Default
  8. 22:00Domain Layer
  9. 26:10Exceptions in async
  10. 27:35Timeout
  11. 28:00Presentation Layer
  12. 30:10Scope
  13. 34:10Exception Handler
  14. 36:05Testing
  15. 41:17Conclusion
~/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.