Package-level declarations

Properties

Link copied to clipboard
actual val Dispatchers.TargetDefault: CoroutineDispatcher
expect val Dispatchers.TargetDefault: CoroutineDispatcher

The default dispatcher on the current platform.

actual val Dispatchers.TargetDefault: CoroutineDispatcher
actual val Dispatchers.TargetDefault: CoroutineDispatcher
actual val Dispatchers.TargetDefault: CoroutineDispatcher
actual val Dispatchers.TargetDefault: CoroutineDispatcher
Link copied to clipboard
actual val Dispatchers.TargetIO: CoroutineDispatcher
expect val Dispatchers.TargetIO: CoroutineDispatcher

The IO dispatcher on the current platform.

actual val Dispatchers.TargetIO: CoroutineDispatcher
actual val Dispatchers.TargetIO: CoroutineDispatcher
actual val Dispatchers.TargetIO: CoroutineDispatcher
actual val Dispatchers.TargetIO: CoroutineDispatcher
Link copied to clipboard
actual val Dispatchers.TargetMain: MainCoroutineDispatcher
expect val Dispatchers.TargetMain: MainCoroutineDispatcher

The main dispatcher on the current platform.

actual val Dispatchers.TargetMain: MainCoroutineDispatcher
actual val Dispatchers.TargetMain: MainCoroutineDispatcher
actual val Dispatchers.TargetMain: MainCoroutineDispatcher
actual val Dispatchers.TargetMain: MainCoroutineDispatcher
Link copied to clipboard
actual val Dispatchers.Virtual: CoroutineDispatcher?
expect val Dispatchers.Virtual: CoroutineDispatcher?

Virtual Dispatcher available on JVM.

actual val Dispatchers.Virtual: CoroutineDispatcher?
actual val Dispatchers.Virtual: CoroutineDispatcher?
actual val Dispatchers.Virtual: CoroutineDispatcher?
actual val Dispatchers.Virtual: CoroutineDispatcher?
Link copied to clipboard
val Dispatchers.VirtualIO: CoroutineDispatcher

Virtual Dispatcher available on JVM or IO fallback.

Functions

Link copied to clipboard
suspend fun <T> Flow<T>.collectSafe(collector: FlowCollector<T>)
suspend fun <T> StateFlow<T>.collectSafe(collector: FlowCollector<T>)

suspend fun <T> Flow<T>.collectSafe(catchTimeout: Boolean, collector: FlowCollector<T>)

Collect Flow without throwing an exception, except CancellationException to cancel parent jobs. Tries to emit a single value if Flow.collect can not be called.

suspend fun <T> StateFlow<T>.collectSafe(catchTimeout: Boolean, collector: FlowCollector<T>)

Collect StateFlow without throwing an exception, except CancellationException to cancel parent jobs. Tries to emit a single value if StateFlow.collect can not be called.

Link copied to clipboard
fun defaultDispatcher(): CoroutineDispatcher

Handy equivalent of Dispatchers.TargetDefault.

Link copied to clipboard
fun ioDispatcher(): CoroutineDispatcher

Handy equivalent of Dispatchers.TargetIO.

Link copied to clipboard
fun CoroutineScope.launchDefault(block: suspend CoroutineScope.() -> Unit): Job

Handy equivalent of CoroutineScope.launch to launch directly with the defaultDispatcher.

Link copied to clipboard
fun CoroutineScope.launchIO(block: suspend CoroutineScope.() -> Unit): Job

Handy equivalent of CoroutineScope.launch to launch directly with the ioDispatcher.

Link copied to clipboard
fun CoroutineScope.launchMain(block: suspend CoroutineScope.() -> Unit): Job

Handy equivalent of CoroutineScope.launch to launch directly with the mainDispatcher.

Link copied to clipboard
fun CoroutineScope.launchVirtual(fallback: CoroutineDispatcher, block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
fun CoroutineScope.launchVirtualIO(block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
fun mainDispatcher(): MainCoroutineDispatcher

Handy equivalent of Dispatchers.TargetMain.

Link copied to clipboard
fun <T> scopeCatching(catchTimeout: Boolean = false, block: () -> T): Result<T>

Equivalent of runCatching but able to throw CancellationException to cancel parent jobs.

Link copied to clipboard
suspend fun <T> suspendCatching(catchTimeout: Boolean = false, block: suspend CoroutineScope.() -> T): Result<T>

Equivalent of a suspendable runCatching but able to throw CancellationException to cancel parent jobs.

Link copied to clipboard
suspend fun <T> suspendSafeCast(block: suspend CoroutineScope.() -> T?): T?

Equivalent of a suspendable safeCast, able to throw CancellationException to cancel parent jobs.

Link copied to clipboard
fun virtualDispatcher(): CoroutineDispatcher?
Link copied to clipboard
fun virtualIODispatcher(): CoroutineDispatcher
Link copied to clipboard
suspend fun <T> withDefaultContext(block: suspend CoroutineScope.() -> T): T

Handy equivalent of withContext to switch directly with the defaultDispatcher.

Link copied to clipboard
suspend fun <T> withIOContext(block: suspend CoroutineScope.() -> T): T

Handy equivalent of withContext to switch directly with the ioDispatcher.

Link copied to clipboard
suspend fun <T> withMainContext(block: suspend CoroutineScope.() -> T): T

Handy equivalent of withContext to switch directly with the mainDispatcher.

Link copied to clipboard
suspend fun <T> withVirtualContext(fallback: CoroutineDispatcher, block: suspend CoroutineScope.() -> T): T
Link copied to clipboard
suspend fun <T> withVirtualIOContext(block: suspend CoroutineScope.() -> T): T