Kotlin Help

Coroutines guide

Kotlin provides only minimal low-level APIs in its standard library to enable other libraries to utilize coroutines. Unlike many other languages with similar capabilities, async and await are not keywords in Kotlin and are not even part of its standard library. Moreover, Kotlin's concept of suspending function provides a safer and less error-prone abstraction for asynchronous operations than futures and promises.

kotlinx.coroutines is a rich library for coroutines developed by JetBrains. It contains a number of high-level coroutine-enabled primitives that this guide covers, including .launch(), .async(), and others.

This is a guide about the core features of kotlinx.coroutines with a series of examples, divided up into different topics. If you prefer learning through videos, watch the Kotlin Coroutines: Full 4-Hour Course from Sebastian Aigner. It covers coroutine fundamentals with practical examples and exercises on structured concurrency, cancellation, exception handling, and flows.

To use coroutines, add a dependency on the kotlinx-coroutines-core module.

Table of contents

Additional references

01 December 2026