@JvmStatic val Main: MainCoroutineDispatcher (source)

A coroutine dispatcher that is confined to the Main thread operating with UI objects. This dispatcher can be used either directly or via MainScope factory. Usually such dispatcher is single-threaded.

Access to this property may throw IllegalStateException if no main thread dispatchers are present in the classpath.

Depending on platform and classpath it can be mapped to different dispatchers:

In order to work with Main dispatcher, following artifact should be added to project runtime dependencies:

Implementation note: MainCoroutineDispatcher.immediate is not supported on Native and JS platforms.