Part 6: Coroutines & Concurrency
Write asynchronous, concurrent code with Kotlin coroutines.
What You’ll Learn
- Suspend functions and the coroutine builders
launch/async - Scopes, context,
Job, and dispatchers - Structured concurrency, cancellation, and exception handling
- Asynchronous streams with
Flow - Channels for coroutine communication
- Testing coroutine and
Flowcode
Chapters
| Chapter | Description |
|---|---|
| Suspend Functions & Builders | suspend, launch, async/await, runBlocking |
| Scopes, Context & Dispatchers | Context, Job, dispatchers, withContext |
| Structured Concurrency | Cancellation, timeouts, exception propagation |
| Asynchronous Streams with Flow | Cold streams, operators, StateFlow/SharedFlow |
| Channels | Producer/consumer communication |
| Testing Coroutines | runTest, virtual time, test dispatchers |