Package-level declarations

Types

Link copied to clipboard
interface RetryFlow<T> : Flow<T>

A Flow instance that can be retried by calling retry. Whatever block or flow emission was before will be re-evaluated (re-created) again.

Link copied to clipboard
interface SuspendLazy<T>

Use this like a lazy, but because operator getValue cannot be suspend, you'll have to invoke this object instead in a suspend context to receive the value.

Link copied to clipboard

The mode in which the SuspendLazy will operate

Functions

Link copied to clipboard
suspend fun <T> Iterable<T>.forEachParallel(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend (T) -> Unit)

Execute block in parallel using operator async for each element of the collection

Link copied to clipboard
fun CoroutineScope.launchCatching(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, onError: CoroutineContext.(Throwable) -> Unit, block: suspend CoroutineScope.() -> Unit): Job

Launch a new coroutine using this scope and context, but catch any Throwables using onError and execute block. The coroutines launched inside block's scope will NOT cancel the scope.

Link copied to clipboard
suspend fun <T, R> Iterable<T>.mapParallel(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend (T) -> R): List<R>

Execute block in parallel using operator async for each element of the collection

Link copied to clipboard
inline fun <T, R> Flow<Iterable<T>>.mapValues(crossinline transform: (T) -> R): Flow<List<R>>

Maps values of each collection this flow emits.

Link copied to clipboard
inline fun <T> retry(crossinline call: suspend () -> T): RetryFlow<T>

Creates a new RetryFlow from this call function, evaluated as a cold flow

Link copied to clipboard
fun <T> retryFlow(flow: suspend () -> Flow<T>): RetryFlow<T>

Creates a new RetryFlow from flow builder

Link copied to clipboard
fun <T> suspendLazy(type: SuspendLazyMode = SuspendLazyMode.Atomic, initializer: suspend CoroutineScope.() -> T): SuspendLazy<T>

Use this like a lazy, but because operator getValue cannot be suspend, you'll have to invoke this object instead in a suspend context to receive the value.