//arrow-fx-coroutines/arrow.fx.coroutines

Package arrow.fx.coroutines

Types

Name Summary
Atomic common interface Atomic<A>
An Atomic with a initial value of A, this is a wrapper around Atomic Fu.
AtomicBooleanW common class AtomicBooleanW(a: Boolean)
AtomicIntW common class AtomicIntW(a: Int)
AtomicRefW common class AtomicRefW<A>(a: A)
CircuitBreaker common class CircuitBreaker
A CircuitBreaker is used to protect resources or services from being overloaded When a service is being overloaded, interacting with it more will only worsen its overloaded state.
ExitCase common sealed class ExitCase
Platform common object Platform
Race3 common sealed class Race3<out A, out B, out C>
Resource common sealed class Resource<out A>
Resource models resource allocation and releasing.
Schedule common sealed class Schedule<Input, Output>
Retrying and repeating effects
A common demand when working with effects is to retry or repeat them when certain circumstances happen.
Use common inline class Use<A>(acquire: suspend () -> A)
Marker for suspend () -> A to be marked as the Use action of a Resource.

Functions

Name Summary
bracket common inline suspend fun <A, B> bracket(crossinline acquire: suspend () -> A, use: suspend (A) -> B, crossinline release: suspend (A) -> Unit): B
Describes a task with safe resource acquisition and release in the face of errors and interruption.
bracketCase common inline suspend fun <A, B> bracketCase(crossinline acquire: suspend () -> A, use: suspend (A) -> B, crossinline release: suspend (A, ExitCase) -> Unit): B
A way to safely acquire a resource and release in the face of errors and cancellation.
fixedRate common fun fixedRate(period: Long, dampen: Boolean = true, timeStampInMillis: () -> Long = { timeInMillis() }): Flow<Unit>
Flow that emits Unit every period while taking into account how much time it takes downstream to consume the emission.
common
@ExperimentalTime()
fun fixedRate(period: Duration, dampen: Boolean = true, timeStampInMillis: () -> Long = { timeInMillis() }): Flow<Unit>
fromAutoCloseable jvm fun <A : AutoCloseable> Resource.Companion.fromAutoCloseable(f: suspend () -> A): Resource<A>
Creates a Resource from an AutoCloseable, which uses AutoCloseable.close for releasing.
fromCloseable jvm fun <A : Closeable> Resource.Companion.fromCloseable(f: suspend () -> A): Resource<A>
Creates a Resource from an Closeable, which uses Closeable.close for releasing.
fromExecutor jvm fun Resource.Companion.fromExecutor(f: suspend () -> ExecutorService): Resource<CoroutineContext>
Creates a single threaded CoroutineContext as a Resource.
guarantee common inline suspend fun <A> guarantee(fa: suspend () -> A, crossinline finalizer: suspend () -> Unit): A
Guarantees execution of a given finalizer after fa regardless of success, error or cancellation.
guaranteeCase common inline suspend fun <A> guaranteeCase(fa: suspend () -> A, crossinline finalizer: suspend (ExitCase) -> Unit): A
Guarantees execution of a given finalizer after fa regardless of success, error or cancellation, allowing for differentiating between exit conditions with the ExitCase argument of the finalizer.
mapIndexed common inline fun <A, B> Flow<A>.mapIndexed(crossinline f: suspend (Int, A) -> B): Flow<B>
metered common fun <A> Flow<A>.metered(period: Long): Flow<A>
common
@ExperimentalTime()
fun <A> Flow<A>.metered(period: Duration): Flow<A>
Flow that emits A every period while taking into account how much time it takes downstream to consume the emission.
never common suspend fun <A> never(): A
onCancel common inline suspend fun <A> onCancel(fa: suspend () -> A, crossinline onCancel: suspend () -> Unit): A
Registers an onCancel handler after fa.
parMap common
@FlowPreview()
@ExperimentalCoroutinesApi()
inline fun <A, B> Flow<A>.parMap(concurrency: Int = DEFAULT_CONCURRENCY, crossinline transform: suspend CoroutineScope.(A) -> B): Flow<B>
Like map, but will evaluate transform in parallel, emitting the results downstream in the same order as the input stream.
parMapUnordered common
@FlowPreview()
inline fun <A, B> Flow<A>.parMapUnordered(concurrency: Int = DEFAULT_CONCURRENCY, crossinline transform: suspend (A) -> B): Flow<B>
Like map, but will evaluate effects in parallel, emitting the results downstream.
parSequence common suspend fun <A> Iterable<suspend () -> A>.parSequence(): List<A>
suspend fun <A> Iterable<suspend () -> A>.parSequence(ctx: CoroutineContext = EmptyCoroutineContext): List<A>
common
@JvmName(name = parSequenceScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> A>.parSequence(): List<A>
Sequences all tasks in parallel on Dispatchers.Default and return the resultCancelling this operation cancels all running tasks.
common
@JvmName(name = parSequenceScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> A>.parSequence(ctx: CoroutineContext = EmptyCoroutineContext): List<A>
Sequences all tasks in parallel and return the resultCoroutine context is inherited from a CoroutineScope, additional context elements can be specified with ctx argument.
parSequenceEither common suspend fun <A, B> Iterable<suspend () -> Either<A, B».parSequenceEither(): Either<A, List<B»
Sequences all tasks in parallel on Dispatchers.Default and return the result.
common
@JvmName(name = parSequenceEitherScoped)
suspend fun <A, B> Iterable<suspend CoroutineScope.() -> Either<A, B».parSequenceEither(): Either<A, List<B»
suspend fun <A, B> Iterable<suspend () -> Either<A, B».parSequenceEither(ctx: CoroutineContext = EmptyCoroutineContext): Either<A, List<B»
common
@JvmName(name = parSequenceEitherScoped)
suspend fun <A, B> Iterable<suspend CoroutineScope.() -> Either<A, B».parSequenceEither(ctx: CoroutineContext = EmptyCoroutineContext): Either<A, List<B»
Sequences all tasks in parallel on ctx and return the result.
parSequenceEitherN common suspend fun <A, B> Iterable<suspend () -> Either<A, B».parSequenceEitherN(n: Int): Either<A, List<B»
Sequences all tasks in n parallel processes on Dispatchers.Default and return the result.
common
@JvmName(name = parSequenceEitherNScoped)
suspend fun <A, B> Iterable<suspend CoroutineScope.() -> Either<A, B».parSequenceEitherN(n: Int): Either<A, List<B»
suspend fun <A, B> Iterable<suspend () -> Either<A, B».parSequenceEitherN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int): Either<A, List<B»
common
@JvmName(name = parSequenceEitherNScoped)
suspend fun <A, B> Iterable<suspend CoroutineScope.() -> Either<A, B».parSequenceEitherN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int): Either<A, List<B»
Sequences all tasks in n parallel processes on ctx and return the result.
parSequenceN common suspend fun <A> Iterable<suspend () -> A>.parSequenceN(n: Int): List<A>
suspend fun <A> Iterable<suspend () -> A>.parSequenceN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int): List<A>
common
@JvmName(name = parSequenceNScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> A>.parSequenceN(n: Int): List<A>
Sequences all tasks in n parallel processes on Dispatchers.Default and return the result.
common
@JvmName(name = parSequenceNScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> A>.parSequenceN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int): List<A>
Sequences all tasks in n parallel processes and return the result.
parSequenceResult common suspend fun <A> Iterable<suspend () -> Result<A».parSequenceResult(ctx: CoroutineContext = EmptyCoroutineContext): Result<List<A»
common
@JvmName(name = parSequenceResultScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> Result<A».parSequenceResult(ctx: CoroutineContext = EmptyCoroutineContext): Result<List<A»
Sequences all tasks in parallel on ctx and returns the result.
parSequenceResultN common suspend fun <A> Iterable<suspend () -> Result<A».parSequenceResultN(n: Int): Result<List<A»
suspend fun <A> Iterable<suspend () -> Result<A».parSequenceResultN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int): Result<List<A»
common
@JvmName(name = parSequenceResultNScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> Result<A».parSequenceResultN(n: Int): Result<List<A»
@JvmName(name = parSequenceResultNScoped)
suspend fun <A> Iterable<suspend CoroutineScope.() -> Result<A».parSequenceResultN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int): Result<List<A»
Traverses this Iterable and runs suspend CoroutineScope.() -> Result<A> in n parallel operations on CoroutineContext.
parSequenceValidated common suspend fun <E, A> Iterable<suspend () -> Validated<E, A».parSequenceValidated(semigroup: Semigroup<E>): Validated<E, List<A»
suspend fun <E, A> Iterable<suspend () -> Validated<E, A».parSequenceValidated(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>): Validated<E, List<A»
common
@JvmName(name = parSequenceValidatedScoped)
suspend fun <E, A> Iterable<suspend CoroutineScope.() -> Validated<E, A».parSequenceValidated(semigroup: Semigroup<E>): Validated<E, List<A»
Sequences all tasks in parallel on Dispatchers.Default and returns the result.
common
@JvmName(name = parSequenceValidatedScoped)
suspend fun <E, A> Iterable<suspend CoroutineScope.() -> Validated<E, A».parSequenceValidated(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>): Validated<E, List<A»
Sequences all tasks in parallel on ctx and returns the result.
parSequenceValidatedN common suspend fun <E, A> Iterable<suspend () -> Validated<E, A».parSequenceValidatedN(semigroup: Semigroup<E>, n: Int): Validated<E, List<A»
suspend fun <E, A> Iterable<suspend () -> Validated<E, A».parSequenceValidatedN(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>, n: Int): Validated<E, List<A»
common
@JvmName(name = parSequenceValidatedNScoped)
suspend fun <E, A> Iterable<suspend CoroutineScope.() -> Validated<E, A».parSequenceValidatedN(semigroup: Semigroup<E>, n: Int): Validated<E, List<A»
@JvmName(name = parSequenceValidatedNScoped)
suspend fun <E, A> Iterable<suspend CoroutineScope.() -> Validated<E, A».parSequenceValidatedN(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>, n: Int): Validated<E, List<A»
Traverses this Iterable and runs f in n parallel operations on CoroutineContext.
parTraverse common suspend fun <A, B> Iterable<A>.parTraverse(f: suspend CoroutineScope.(A) -> B): List<B>
Traverses this Iterable and runs all mappers f on Dispatchers.Default.
common suspend fun <A, B> Iterable<A>.parTraverse(ctx: CoroutineContext = EmptyCoroutineContext, f: suspend CoroutineScope.(A) -> B): List<B>
Traverses this Iterable and runs all mappers f on CoroutineContext.
parTraverseEither common suspend fun <A, B, E> Iterable<A>.parTraverseEither(f: suspend CoroutineScope.(A) -> Either<E, B>): Either<E, List<B»
Traverses this Iterable and runs all mappers f on Dispatchers.Default.
common suspend fun <A, B, E> Iterable<A>.parTraverseEither(ctx: CoroutineContext = EmptyCoroutineContext, f: suspend CoroutineScope.(A) -> Either<E, B>): Either<E, List<B»
Traverses this Iterable and runs all mappers f on CoroutineContext.
parTraverseEitherN common suspend fun <A, B, E> Iterable<A>.parTraverseEitherN(n: Int, f: suspend CoroutineScope.(A) -> Either<E, B>): Either<E, List<B»
suspend fun <A, B, E> Iterable<A>.parTraverseEitherN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int, f: suspend CoroutineScope.(A) -> Either<E, B>): Either<E, List<B»
Traverses this Iterable and runs f in n parallel operations on Dispatchers.Default.
parTraverseN common suspend fun <A, B> Iterable<A>.parTraverseN(n: Int, f: suspend CoroutineScope.(A) -> B): List<B>
Traverses this Iterable and runs f in n parallel operations on Dispatchers.Default.
common suspend fun <A, B> Iterable<A>.parTraverseN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int, f: suspend CoroutineScope.(A) -> B): List<B>
Traverses this Iterable and runs f in n parallel operations on ctx.
parTraverseResult common suspend fun <A, B> Iterable<A>.parTraverseResult(f: suspend CoroutineScope.(A) -> Result<B>): Result<List<B»
Traverses this Iterable and runs all mappers f on Dispatchers.Default.
common suspend fun <A, B> Iterable<A>.parTraverseResult(ctx: CoroutineContext = EmptyCoroutineContext, f: suspend CoroutineScope.(A) -> Result<B>): Result<List<B»
Traverses this Iterable and runs all mappers f on CoroutineContext.
parTraverseResultN common suspend fun <A, B> Iterable<A>.parTraverseResultN(n: Int, f: suspend CoroutineScope.(A) -> Result<B>): Result<List<B»
Traverses this Iterable and runs f in n parallel operations on Dispatchers.Default.
common suspend fun <A, B> Iterable<A>.parTraverseResultN(ctx: CoroutineContext = EmptyCoroutineContext, n: Int, f: suspend CoroutineScope.(A) -> Result<B>): Result<List<B»
Traverses this Iterable and runs f in n parallel operations on CoroutineContext.
parTraverseValidated common suspend fun <E, A, B> Iterable<A>.parTraverseValidated(semigroup: Semigroup<E>, f: suspend CoroutineScope.(A) -> Validated<E, B>): Validated<E, List<B»
Traverses this Iterable and runs all mappers f on Dispatchers.Default.
common suspend fun <E, A, B> Iterable<A>.parTraverseValidated(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>, f: suspend CoroutineScope.(A) -> Validated<E, B>): Validated<E, List<B»
Traverses this Iterable and runs all mappers f on CoroutineContext.
parTraverseValidatedN common suspend fun <E, A, B> Iterable<A>.parTraverseValidatedN(semigroup: Semigroup<E>, n: Int, f: suspend CoroutineScope.(A) -> Validated<E, B>): Validated<E, List<B»
Traverses this Iterable and runs f in n parallel operations on Dispatchers.Default.
common suspend fun <E, A, B> Iterable<A>.parTraverseValidatedN(ctx: CoroutineContext = EmptyCoroutineContext, semigroup: Semigroup<E>, n: Int, f: suspend CoroutineScope.(A) -> Validated<E, B>): Validated<E, List<B»
Traverses this Iterable and runs f in n parallel operations on CoroutineContext.
parZip common inline suspend fun <A, B, C> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline f: suspend CoroutineScope.(A, B) -> C): C
Runs fa, fb in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline f: suspend CoroutineScope.(A, B) -> C): C
Runs fa, fb in parallel on ctx and combines their results using the provided function.
common inline suspend fun <A, B, C, D> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline f: suspend CoroutineScope.(A, B, C) -> D): D
Runs fa, fb, fc in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C, D> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline f: suspend CoroutineScope.(A, B, C) -> D): D
Runs fa, fb, fc in parallel on ctx and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline f: suspend CoroutineScope.(A, B, C, D) -> E): E
Runs fa, fb, fc, fd in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline f: suspend CoroutineScope.(A, B, C, D) -> E): E
Runs fa, fb, fc, fd in parallel on ctx and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline f: suspend CoroutineScope.(A, B, C, D, E) -> F): F
Runs fa, fb, fc, fd, fe in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline f: suspend CoroutineScope.(A, B, C, D, E) -> F): F
Runs fa, fb, fc, fd, fe in parallel on ctx and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F, G> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline ff: suspend CoroutineScope.() -> F, crossinline f: suspend CoroutineScope.(A, B, C, D, E, F) -> G): G
Runs fa, fb, fc, fd, fe, ff in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F, G> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline ff: suspend CoroutineScope.() -> F, crossinline f: suspend CoroutineScope.(A, B, C, D, E, F) -> G): G
Runs fa, fb, fc, fd, fe, ff in parallel on ctx and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F, G, H> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline ff: suspend CoroutineScope.() -> F, crossinline fg: suspend CoroutineScope.() -> G, crossinline f: suspend CoroutineScope.(A, B, C, D, E, F, G) -> H): H
Runs fa, fb, fc, fd, fe, ff, fg in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F, G, H> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline ff: suspend CoroutineScope.() -> F, crossinline fg: suspend CoroutineScope.() -> G, crossinline f: suspend CoroutineScope.(A, B, C, D, E, F, G) -> H): H
Runs fa, fb, fc, fd, fe, ff, fg in parallel on ctx and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F, G, H, I> parZip(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline ff: suspend CoroutineScope.() -> F, crossinline fg: suspend CoroutineScope.() -> G, crossinline fh: suspend CoroutineScope.() -> H, crossinline f: suspend CoroutineScope.(A, B, C, D, E, F, G, H) -> I): I
Runs fa, fb, fc, fd, fe, ff, fg, fh in parallel on Dispatchers.Default and combines their results using the provided function.
common inline suspend fun <A, B, C, D, E, F, G, H, I> parZip(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C, crossinline fd: suspend CoroutineScope.() -> D, crossinline fe: suspend CoroutineScope.() -> E, crossinline ff: suspend CoroutineScope.() -> F, crossinline fg: suspend CoroutineScope.() -> G, crossinline fh: suspend CoroutineScope.() -> H, crossinline f: suspend CoroutineScope.(A, B, C, D, E, F, G, H) -> I): I
Runs fa, fb, fc, fd, fe, ff, fg, fh in parallel on ctx and combines their results using the provided function.
raceN common inline suspend fun <A, B> raceN(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B): Either<A, B>
Races the participants fa, fb in parallel on the Dispatchers.Default.
common inline suspend fun <A, B> raceN(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B): Either<A, B>
Races the participants fa, fb on the provided CoroutineContext.
common inline suspend fun <A, B, C> raceN(crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C): Race3<A, B, C>
Races the participants fa, fb & fc in parallel on the Dispatchers.Default.
common inline suspend fun <A, B, C> raceN(ctx: CoroutineContext = EmptyCoroutineContext, crossinline fa: suspend CoroutineScope.() -> A, crossinline fb: suspend CoroutineScope.() -> B, crossinline fc: suspend CoroutineScope.() -> C): Race3<A, B, C>
Races the participants fa, fb & fc on the provided CoroutineContext.
release common infix fun <A> Use<A>.release(release: suspend (A) -> Unit): Resource<A>
Composes a release action to a Resource.use action creating a Resource.
releaseCase common infix fun <A> Use<A>.releaseCase(release: suspend (A, ExitCase) -> Unit): Resource<A>
Composes a releaseCase action to a Resource.use action creating a Resource.
repeat common fun <A> Flow<A>.repeat(): Flow<A>
Repeats the Flow forever
resource common fun <A> resource(acquire: suspend () -> A): Use<A>
Marks an acquire operation as the Resource.use step of a Resource.
retry common suspend fun <A, B> Schedule<Throwable, B>.retry(fa: suspend () -> A): A
Runs an effect and, if it fails, decide using the provided policy if the effect should be retried and if so, with how much delay.
common fun <A, B> Flow<A>.retry(schedule: Schedule<Throwable, B>): Flow<A>
Retries collection of the given flow when an exception occurs in the upstream flow based on a decision by the schedule.
retryOrElse common suspend fun <A, B> Schedule<Throwable, B>.retryOrElse(fa: suspend () -> A, orElse: suspend (Throwable, B) -> A): A
Runs an effect and, if it fails, decide using the provided policy if the effect should be retried and if so, with how much delay.
retryOrElseEither common suspend fun <A, B, C> Schedule<Throwable, B>.retryOrElseEither(fa: suspend () -> A, orElse: suspend (Throwable, B) -> C): Either<C, A>
Runs an effect and, if it fails, decide using the provided policy if the effect should be retried and if so, with how much delay.
sequence common inline fun <A> Iterable<Resource<A».sequence(): Resource<List<A»
Sequences this Iterable of Resources.
singleThreadContext jvm fun Resource.Companion.singleThreadContext(name: String): Resource<CoroutineContext>
Creates a single threaded CoroutineContext as a Resource.
timeInMillis commonjsjvmnative commonjsjvmnative fun timeInMillis(): Long
traverseResource common inline fun <A, B> Iterable<A>.traverseResource(crossinline f: (A) -> Resource<B>): Resource<List<B»
Traverse this Iterable and collects the resulting Resource<B> of f into a Resource<List<B>>.
unit common suspend fun unit()

Do you like Arrow?

Arrow Org
<