• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<contribute-url>https://github.com/Kotlin/kotlinx.coroutines/edit/master/docs/topics/</contribute-url>
2
3
4[//]: # (title: Coroutines guide)
5
6Kotlin provides only minimal low-level APIs in its standard library to enable other
7libraries to utilize coroutines. Unlike many other languages with similar capabilities, `async` and `await`
8are not keywords in Kotlin and are not even part of its standard library. Moreover, Kotlin's concept
9of _suspending function_ provides a safer and less error-prone abstraction for asynchronous
10operations than futures and promises.
11
12`kotlinx.coroutines` is a rich library for coroutines developed by JetBrains. It contains a number of high-level
13coroutine-enabled primitives that this guide covers, including `launch`, `async`, and others.
14
15This is a guide about the core features of `kotlinx.coroutines` with a series of examples, divided up into different topics.
16
17In order to use coroutines as well as follow the examples in this guide, you need to add a dependency on the `kotlinx-coroutines-core` module as explained
18[in the project README](https://github.com/Kotlin/kotlinx.coroutines/blob/master/README.md#using-in-your-projects).
19
20## Table of contents
21
22* [Coroutines basics](coroutines-basics.md)
23* [Hands-on: Intro to coroutines and channels](https://play.kotlinlang.org/hands-on/Introduction%20to%20Coroutines%20and%20Channels)
24* [Cancellation and timeouts](cancellation-and-timeouts.md)
25* [Composing suspending functions](composing-suspending-functions.md)
26* [Coroutine context and dispatchers](coroutine-context-and-dispatchers.md)
27* [Asynchronous Flow](flow.md)
28* [Channels](channels.md)
29* [Coroutine exceptions handling](exception-handling.md)
30* [Shared mutable state and concurrency](shared-mutable-state-and-concurrency.md)
31* [Select expression (experimental)](select-expression.md)
32* [Tutorial: Debug coroutines using IntelliJ IDEA](debug-coroutines-with-idea.md)
33* [Tutorial: Debug Kotlin Flow using IntelliJ IDEA](debug-flow-with-idea.md)
34
35## Additional references
36
37* [Guide to UI programming with coroutines](https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md)
38* [Coroutines design document (KEEP)](https://github.com/Kotlin/KEEP/blob/master/proposals/coroutines.md)
39* [Full kotlinx.coroutines API reference](https://kotlinlang.org/api/kotlinx.coroutines/)
40* [Best practices for coroutines in Android](https://developer.android.com/kotlin/coroutines/coroutines-best-practices)
41* [Additional Android resources for Kotlin coroutines and flow](https://developer.android.com/kotlin/coroutines/additional-resources)
42