Skip to content

Update Dispatchers.Main documentation #3450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions kotlinx-coroutines-core/common/src/Dispatchers.common.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ public expect object Dispatchers {
* Access to this property may throw an [IllegalStateException] if no main dispatchers are present in the classpath.
*
* Depending on platform and classpath, it can be mapped to different dispatchers:
* - On JS and Native it is equivalent to the [Default] dispatcher.
* - On JVM it is either the Android main thread dispatcher, JavaFx or Swing EDT dispatcher. It is chosen by the
* [`ServiceLoader`](https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html).
* - On JS it is equivalent to the [Default] dispatcher with [immediate][MainCoroutineDispatcher.immediate] support.
* - On Native Darwin-based targets, it is a dispatcher backed by Darwin's main queue.
* - On other Native targets, it is a single-threaded dispatcher backed by a standalone worker.
*
* In order to work with the `Main` dispatcher, the following artifact should be added to the project runtime dependencies:
* - `kotlinx-coroutines-android` — for Android Main thread dispatcher
* - `kotlinx-coroutines-javafx` — for JavaFx Application thread dispatcher
* - `kotlinx-coroutines-swing` — for Swing EDT dispatcher
*
* Implementation note: [MainCoroutineDispatcher.immediate] is not supported on the Native and JS platforms.
*/
public val Main: MainCoroutineDispatcher

Expand Down