Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Kotlin Coroutines & Flow: Learn How They Really Work
New
7 students

Kotlin Coroutines & Flow: Learn How They Really Work

Master Kotlin Coroutines and Flow through suspension, concurrency, cancellation, exceptions, and real execution models.
Created byDev Chan
Last updated 10/2026
English

What you'll learn

  • Understand how Kotlin coroutines work under the hood, including suspension, continuations, coroutine state machines, and how suspended code resumes execution.
  • Learn how to use coroutine builders effectively, including launch, async, coroutineScope, supervisorScope, and runBlocking.
  • Master structured concurrency and understand how parent-child relationships, coroutine lifecycles, completion, and failures are managed.
  • Understand coroutine cancellation from the inside out, including cancellation propagation, cooperative cancellation, CancellationException and finally
  • Develop a strong mental model for concurrent programming, allowing you to reason about coroutine behavior instead of simply memorizing APIs.
  • Debug and troubleshoot coroutine-based code with confidence by understanding what happens during suspension, resumption, cancellation, and failure.
  • Build knowledge that goes beyond Kotlin, including fundamental concepts such as suspension, continuations, asynchronous programming, cooperative cancellation

Course content

8 sections • 84 lectures • 9h 48m total length
  • From Threads to Coroutines: Understanding the Problem4:08

    Understand why concurrency is needed and the problems that arise when relying on traditional threads.

  • Thread Crashes and Their Limits2:46

    Explore the practical limitations of threads and why creating too many threads becomes a problem.

  • Coroutine Scalability: 100,000 Coroutines vs Threads5:47

    See why coroutines are lightweight by comparing them with threads at large scale.

  • Introduction to Coroutines3:56

    Get an intuitive introduction to coroutines and understand how they differ from threads.

  • Kotlin Prerequisites — What You Need Before We Begin9:18

    Review the Kotlin concepts needed to follow the coroutine examples throughout the course.

Requirements

  • Basic knowledge of Kotlin programming, including functions, lambdas, and object-oriented programming. No prior coroutine experience is required.

Description

Kotlin Coroutines and Flow are powerful, but simply learning their APIs is not enough. To use them confidently, you need to understand what actually happens when a coroutine suspends, resumes, runs concurrently, gets cancelled, or encounters an exception.

This course takes a deep, conceptual approach to Kotlin Coroutines and Flow. Instead of focusing on memorizing functions and APIs, you'll build a strong mental model of how they work and, more importantly, why they behave the way they do.

You'll begin by understanding the problems with traditional threads, blocking operations, and concurrent programming, and why coroutines provide a lightweight and scalable approach to concurrency. You'll then explore suspension, continuations, suspension points, and coroutine state machines to understand what the suspend keyword really means and what happens when a coroutine pauses and resumes.

From there, you'll learn coroutine builders, Jobs, parent-child relationships, structured concurrency, CoroutineScope, CoroutineContext, dispatchers, cancellation, and exception handling through practical examples and execution-focused explanations.

The course then moves into Kotlin Flow, where you'll develop a clear understanding of cold flows, collection, emission, operators, context preservation, flowOn, cancellation, exceptions, combination, flattening, SharedFlow, StateFlow, shareIn, and stateIn.

Throughout the course, concepts are introduced using a problem → why → solution approach, helping you understand not only how to use an API, but why it exists.

By the end of the course, you won't just have a collection of Coroutine and Flow APIs. You'll have the mental model needed to reason about, debug, design, and use concurrent Kotlin applications with confidence.

Who this course is for:

  • Anyone with basic Kotlin programming knowledge who wants to understand how coroutines work, why they matter, and what happens under the hood.