ratpack.kotlin.rx.RxRatpackKotlin.kt Maven / Gradle / Ivy
package ratpack.kotlin.rx
import ratpack.exec.ExecController
import ratpack.exec.Operation
import ratpack.exec.Promise
import ratpack.func.Action
import ratpack.registry.RegistrySpec
import ratpack.rx.RxRatpack
import rx.Observable
/**
* rx extension functions.
* see https://ratpack.io/manual/current/api/ratpack/rx/RxRatpack.html for details.
*/
/**
* @see RxRatpack.initialize
*/
fun initialize() = RxRatpack.initialize()
// convert promises to observables
fun Promise.observe(): Observable = RxRatpack.observe(this)
fun Operation.observe(): Observable = RxRatpack.observe(this)
fun > Promise.observeEach() = RxRatpack.observeEach(this)
// convert observables to promises
fun Observable.promise() = RxRatpack.promise(this)
fun Observable.promiseSingle() = RxRatpack.promiseSingle(this)
fun Observable.OnSubscribe.promise() = RxRatpack.promise(this)
fun Observable.OnSubscribe.promiseSingle() = RxRatpack.promiseSingle(this)
// convert observables to publishers
fun Observable.publisher() = RxRatpack.publisher(this)
fun Observable.OnSubscribe.publisher() = RxRatpack.publisher(this)
// observable thread binding
fun Observable.bindExec() = RxRatpack.bindExec(this)
fun Observable.fork() = RxRatpack.fork(this)
fun Observable.fork(doWithRegistrySpec: Action) = RxRatpack.fork(this, doWithRegistrySpec)
fun Observable.fork(doWithRegistrySpec: RegistrySpec.() -> Unit) = RxRatpack.fork(this, doWithRegistrySpec)
fun Observable.forkEach() = RxRatpack.forkEach(this)
fun Observable.forkEach(doWithRegistrySpec: Action) = RxRatpack.forkEach(this, doWithRegistrySpec)
fun Observable.forkEach(doWithRegistrySpec: RegistrySpec.() -> Unit) = RxRatpack.forkEach(this, doWithRegistrySpec)
// schedulers
fun scheduler(execController: ExecController) = RxRatpack.scheduler(execController)
fun scheduler() = RxRatpack.scheduler()
© 2015 - 2024 Weber Informatics LLC | Privacy Policy