L15: Contexts and Dispatchers
What will you learn in this lesson?
Section titled “What will you learn in this lesson?”In this lesson we will explore:
- Deep Theory: Elements of
CoroutineContext, safe thread switching withwithContext, specific roles ofDispatchers.IO,Dispatchers.Default, andDispatchers.Unconfined, and exception handling withCoroutineExceptionHandler. - Under the Hood: How Dispatchers back onto adaptive JVM thread pools (
ForkJoinPool/ worker threads). - Incremental Lab (AI Chat CLI): Isolating blocking network calls to remote AI APIs onto
Dispatchers.IOwhile processing token streaming onDispatchers.Default.
Navigation
Section titled “Navigation” ← Course Syllabus Return to the full lesson curriculum.
← Previous Lesson (L14) Suspension and Concurrency Scopes.
Next Lesson (L16) → Final Project: AI Chat CLI.