open class RxHelper
A set of helpers for RxJava and Vert.x.
Author
Julien Viet
RxHelper()
A set of helpers for RxJava and Vert.x. |
open static fun blockingScheduler(vertx: Vertx): Scheduleropen static fun blockingScheduler(vertx: Vertx, ordered: Boolean): Scheduler
Create a scheduler for a Vertx object, actions can be blocking, they are not executed on Vertx event loop. |
|
open static fun <T : Any> observableFuture(): ObservableFuture<T>
Create a new |
|
open static fun <T : Any> observableHandler(): ObservableHandler<T>
Create a new open static fun <T : Any> observableHandler(multi: Boolean): ObservableHandler<T>
Create a new |
|
open static fun scheduler(vertx: Vertx): Scheduler
Create a scheduler for a Vertx object, actions are executed on the event loop. open static fun scheduler(context: Context): Scheduler
Create a scheduler for a Context, actions are executed on the event loop of this context. |
|
open static fun schedulerHook(context: Context): RxJavaSchedulersHook
Create a scheduler hook for a Context object, the open static fun schedulerHook(vertx: Vertx): RxJavaSchedulersHook
Create a scheduler hook for a Vertx object, the |
|
open static fun <T : Any> toFuture(observer: Observer<T>): Handler<AsyncResult<T>>
Adapt a Subscriber as a open static fun <T : Any> toFuture(onNext: Action1<T>): Handler<AsyncResult<T>>
Adapt an item callback as a open static fun <T : Any> toFuture(onNext: Action1<T>, onError: Action1<Throwable>): Handler<AsyncResult<T>>open static fun <T : Any> toFuture(onNext: Action1<T>, onError: Action1<Throwable>, onComplete: Action0): Handler<AsyncResult<T>>
Adapt an item callback and an error callback as a |
|
open static fun <T : Any> toHandler(observer: Observer<T>): Handler<T>
Adapt a Subscriber as a open static fun <T : Any> toHandler(observer: Observer<T>, multi: Boolean): Handler<T>
Adapt a Subscriber as a open static fun <T : Any> toHandler(onNext: Action1<T>): Handler<T>
Adapt an item callback as a |
|
open static fun <T : Any> toObservable(stream: ReadStream<T>): Observable<T>
Adapts a Vert.x < to an RxJava <. After the stream is adapted to an observable, the original stream handlers should not be used anymore as they will be used by the observable adapter. The adapter supports reactive pull back-pressure. When back-pressure is enabled, a buffer of
open static fun <T : Any> toObservable(stream: ReadStream<T>, maxBufferSize: Int): Observable<T>
Adapts a Vert.x < to an RxJava <. After the stream is adapted to an observable, the original stream handlers should not be used anymore as they will be used by the observable adapter. The adapter supports reactive pull back-pressure. When back-pressure is enabled, a buffer of
open static fun <T : Any, R : Any> toObservable(stream: ReadStream<T>, adapter: Function<T, R>): Observable<R>
Like open static fun <T : Any, R : Any> toObservable(stream: ReadStream<T>, adapter: Function<T, R>, maxBufferSize: Int): Observable<R>
Like |
|
open static fun <T : Any> toReadStream(observable: Observable<T>): ReadStream<T>
Adapts an RxJava < to a Vert.x <. The returned readstream will be subscribed to the <. |
|
open static fun <T : Any> toSubscriber(handler: Handler<AsyncResult<T>>): Subscriber<T>
Adapts an Vert.x The returned subscriber can be subscribed to an |
|
open static fun <T : Any> unmarshaller(mappedType: Class<T>, mapper: ObjectMapper): Operator<T, Buffer>
Returns a unmarshaller for the specified java type as a rx.Observable.Operator instance given the the provided com.fasterxml.jackson.databind.ObjectMapper The marshaller can be used with the open static fun <T : Any> unmarshaller(mappedType: Class<T>): Operator<T, Buffer>
Returns a json unmarshaller for the specified java type as a rx.Observable.Operator instance. The marshaller can be used with the open static fun <T : Any> unmarshaller(mappedTypeRef: TypeReference<T>): Operator<T, Buffer>
Returns a json unmarshaller for the specified java type as a rx.Observable.Operator instance. The marshaller can be used with the open static fun <T : Any> unmarshaller(mappedTypeRef: TypeReference<T>, mapper: ObjectMapper): Operator<T, Buffer>
Returns a unmarshaller for the specified java type as a rx.Observable.Operator instance given the the provided com.fasterxml.jackson.databind.ObjectMapper The marshaller can be used with the |