All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.de.halfbit.componental.coroutines.ComponentalDispatchers.kt Maven / Gradle / Ivy

package de.halfbit.componental.coroutines

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers

public object ComponentalDispatchers {

    public val optimalMain: CoroutineDispatcher by lazy {
        try {
            Dispatchers.Main.immediate
        } catch (e: UnsupportedOperationException) {
            Dispatchers.Main
        }
    }

    public val contextCoroutineDispatcher: CoroutineDispatcher
        get() = Dispatchers.Default
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy