TaskDispatchers
-
Cmn
interface TaskDispatchers
Interface providing access to CoroutineDispatchers used for task execution inside a Compose hierarchy.
import androidx.compose.material3.Text import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.platform.LocalTaskDispatchers val taskDispatchers = LocalTaskDispatchers.current LaunchedEffect(taskDispatchers) { withContext(taskDispatchers.IO) { // Perform background I/O operations using the provided IO context } } Text("TaskDispatchers Sample")
Summary
Public properties |
||
|---|---|---|
CoroutineDispatcher |
A |
Cmn
|
CoroutineDispatcher |
A |
Cmn
|
Public properties
Default
val Default: CoroutineDispatcher
A CoroutineDispatcher optimized for performing CPU-intensive work outside of the UI thread.
IO
val IO: CoroutineDispatcher
A CoroutineDispatcher designed for offloading blocking I/O tasks to a shared pool of threads.