arrow-fx / arrow.fx.typeclasses / Async

Async

interface ~~Async~~<F> : MonadDefer<F> Deprecated: The IO datatype and it’s related type classes will disappear in Arrow 0.13.0. All useful operations are offered directly over suspend functions by Arrow Fx Coroutines. https://arrow-kt.io/docs/fx/async/

Async models how a data type runs an asynchronous computation that may fail. Defined by the Proc signature, which is the consumption of a callback.

Properties

fx Entry point for monad bindings which enables for comprehensions. The underlying impl is based on coroutines. A coroutines is initiated and inside AsyncContinuation suspended yielding to Monad.flatMap. Once all the flatMap binds are completed the underlying monad is returned from the act of executing the coroutineopen val fx: AsyncFx<F>

Functions

async Creates an instance of F that executes an asynchronous process on evaluation.open fun <A> async(fa: Proc<A>): Kind<F, A>
asyncF async variant that can suspend side effects in the provided registration function.abstract fun <A> asyncF(k: ProcF<F, A>): Kind<F, A>
continueOn Continue the evaluation on provided CoroutineContextabstract fun <A> Kind<F, A>.continueOn(ctx: CoroutineContext): Kind<F, A>
Shift evaluation to provided CoroutineContext.open suspend fun AsyncSyntax<F>.continueOn(ctx: CoroutineContext): Unit
defer Delay a computation on provided CoroutineContext.open fun <A> defer(ctx: CoroutineContext, f: () -> Kind<F, A>): Kind<F, A>
effect Delay a suspended effect.open fun <A> effect(f: suspend () -> A): Kind<F, A>
Delay a suspended effect on provided CoroutineContext.open fun <A> effect(ctx: CoroutineContext, f: suspend () -> A): Kind<F, A>
effectMap Helper function that provides an easy way to construct a suspend effectopen fun <A, B> Kind<F, A>.effectMap(f: suspend (A) -> B): Kind<F, B>
later Delay a computation on provided CoroutineContext.open fun <A> later(ctx: CoroutineContext, f: () -> A): Kind<F, A>
laterOrRaise Delay a computation on provided CoroutineContext.open fun <A> laterOrRaise(ctx: CoroutineContext, f: () -> Either<Throwable, A>): Kind<F, A>
never Task that never finishes evaluating.open fun <A> never(): Kind<F, A>
shift Shift evaluation to provided CoroutineContext.open fun CoroutineContext.shift(): Kind<F, Unit>

Inheritors

AsyncContinuation open class ~~AsyncContinuation~~<F, A> : MonadThrowContinuation<F, A>, Async<F>, AsyncSyntax<F>
AsyncSyntax interface ~~AsyncSyntax~~<F> : MonadThrowSyntax<F>, Async<F>
Concurrent Type class for async data types that are cancellable and can be started concurrently.interface ~~Concurrent~~<F> : Async<F>
Effect interface ~~Effect~~<F> : Async<F>
IOAsync interface ~~IOAsync~~ : Async<ForIO>, IOMonadDefer

Do you like Arrow?

Arrow Org
<