uniflow-core / io.uniflow.core.threading

Package io.uniflow.core.threading

Extensions for External Classes

kotlinx.coroutines.CoroutineScope

Functions

onDefault

suspend fun <T> onDefault(block: suspend CoroutineScope.() -> T): T

Switch current execution context to Default Thread

onIO

suspend fun <T> onIO(block: suspend CoroutineScope.() -> T): T

Switch current execution context to IO Thread

onMain

suspend fun <T> onMain(immediate: Boolean = false, block: suspend CoroutineScope.() -> T): T

Switch current execution context to Main thread