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 Flow code

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

Table of contents


Back to top

Kotlin & Android Programming Guide is not affiliated with JetBrains or Google. Content is provided for educational purposes.

This site uses Just the Docs, a documentation theme for Jekyll.