arrow-effects-kotlinx-coroutines-data / arrow.effects.coroutines / arrow.Kind

Extensions for arrow.Kind

await suspend fun <A> DeferredKOf<A>.await(): A
Awaits the value of a DeferredK.
fix fun <A> DeferredKOf<A>.fix(): DeferredK<A>
handleErrorWith fun <A> DeferredKOf<A>.handleErrorWith(f: (Throwable) -> DeferredKOf<A>): DeferredK<A>
Handle errors from MonadThrow
runAsync fun <A> DeferredKOf<A>.runAsync(cb: (Either<Throwable, A>) -> DeferredKOf<Unit>): DeferredK<Unit>
Runs the DeferredK asynchronously and continues with the DeferredK returned by cb.
runAsyncCancellable fun <A> DeferredKOf<A>.runAsyncCancellable(onCancel: OnCancel = OnCancel.Silent, cb: (Either<Throwable, A>) -> DeferredKOf<Unit>): DeferredK<Disposable>
Runs the DeferredK asynchronously and continues with the DeferredK returned by cb. Also provides means to cancel the execution.
scope fun <A> DeferredKOf<A>.scope(): CoroutineScope
Returns the CoroutineScope the DeferredK operates on
unsafeAttemptSync fun <A> DeferredKOf<A>.unsafeAttemptSync(): Try<A>
Wrap unsafeRunSync in Try to catch any thrown errors
unsafeRunAsync fun <A> DeferredKOf<A>.unsafeRunAsync(cb: (Either<Throwable, A>) -> Unit): Unit
Runs the DeferredK asynchronously and then runs the cb. Catches all errors that may be thrown in await. Errors from cb will still throw as expected.
unsafeRunAsyncCancellable fun <A> DeferredKOf<A>.unsafeRunAsyncCancellable(onCancel: OnCancel = OnCancel.Silent, cb: (Either<Throwable, A>) -> Unit): Disposable
unsafeRunSync fun <A> DeferredKOf<A>.unsafeRunSync(): A
Runs this DeferredK with runBlocking. Does not handle errors at all, rethrowing them if they happen. Use unsafeAttemptSync if they should be caught automatically.
value fun <A> DeferredKOf<A>.value(): Deferred<A>
Return the wrapped Deferred from a DeferredK