arrow-effects-rx2-data / arrow.effects.rx2 / ObservableK

ObservableK

@higherkind data class ObservableK<A> : ObservableKOf<A>, ObservableKKindedJ<A>

Constructors

<init> ObservableK(observable: Observable<A>)

Properties

observable val observable: Observable<A>

Functions

ap fun <B> ap(fa: ObservableKOf<(A) -> B>): ObservableK<B>
bracketCase fun <B> bracketCase(use: (A) -> ObservableKOf<B>, release: (A, ExitCase<Throwable>) -> ObservableKOf<Unit>): ObservableK<B>
A way to safely acquire a resource and release in the face of errors and cancellation. It uses ExitCase to distinguish between different exit cases when releasing the acquired resource.
concatMap fun <B> concatMap(f: (A) -> ObservableKOf<B>): ObservableK<B>
continueOn fun continueOn(ctx: CoroutineContext): ObservableK<A>
equals fun equals(other: Any?): Boolean
flatMap fun <B> flatMap(f: (A) -> ObservableKOf<B>): ObservableK<B>
foldLeft fun <B> foldLeft(b: B, f: (B, A) -> B): B
foldRight fun <B> foldRight(lb: Eval<B>, f: (A, Eval<B>) -> Eval<B>): Eval<B>
handleErrorWith fun handleErrorWith(function: (Throwable) -> ObservableKOf<A>): ObservableK<A>
hashCode fun hashCode(): Int
map fun <B> map(f: (A) -> B): ObservableK<B>
runAsync fun runAsync(cb: (Either<Throwable, A>) -> ObservableKOf<Unit>): ObservableK<Unit>
runAsyncCancellable fun runAsyncCancellable(cb: (Either<Throwable, A>) -> ObservableKOf<Unit>): ObservableK<Disposable>
switchMap fun <B> switchMap(f: (A) -> ObservableKOf<B>): ObservableK<B>
traverse fun <G, B> traverse(GA: Applicative<G>, f: (A) -> Kind<G, B>): Kind<G, ObservableK<B>>

Companion Object Functions

async fun <A> async(fa: ObservableKProc<A>): ObservableK<A>
Creates a ObservableK that’ll run ObservableKProc.
asyncF fun <A> asyncF(fa: ObservableKProcF<A>): ObservableK<A>
defer fun <A> defer(fa: () -> ObservableKOf<A>): ObservableK<A>
invoke operator fun <A> invoke(fa: () -> A): ObservableK<A>
just fun <A> just(a: A): ObservableK<A>
raiseError fun <A> raiseError(t: Throwable): ObservableK<A>
tailRecM tailrec fun <A, B> tailRecM(a: A, f: (A) -> ObservableKOf<Either<A, B>>): ObservableK<B>

Extension Functions

unsafeRunAsync fun <A> SingleKOf<A>.unsafeRunAsync(cb: (Either<Throwable, A>) -> Unit): Unit
Runs the SingleK asynchronously and then runs the cb. Catches all errors that may be thrown in await. Errors from cb will still throw as expected.
unsafeRunSync fun <A> SingleKOf<A>.unsafeRunSync(): A
Runs this SingleK with Single.blockingGet. Does not handle errors at all, rethrowing them if they happen.