MainCoroutineDispatcher

abstract class MainCoroutineDispatcher : CoroutineDispatcher

Base class for special CoroutineDispatcher which is confined to application "Main" or "UI" thread and used for any UI-based activities. Instance of MainDispatcher can be obtained by Dispatchers.Main.

Platform may or may not provide instance of MainDispatcher, see documentation to Dispatchers.Main

Constructors

MainCoroutineDispatcher
Link copied to clipboard
common
fun MainCoroutineDispatcher()

Functions

toString
Link copied to clipboard
common
open override fun toString(): String
Returns a name of this main dispatcher for debugging purposes.

Properties

immediate
Link copied to clipboard
common
abstract val immediate: MainCoroutineDispatcher
Returns dispatcher that executes coroutines immediately when it is already in the right context (e.g.

Sources

common source
Link copied to clipboard