Class RxHelper
java.lang.Object
io.vertx.reactivex.RxHelper
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SchedulerblockingScheduler(Vertx vertx) Create a scheduler for aVertxobject, actions can be blocking, they are not executed on Vertx event loop.static SchedulerblockingScheduler(Vertx vertx, boolean ordered) Create a scheduler for aVertxobject, actions can be blocking, they are not executed on Vertx event loop.static SchedulerblockingScheduler(WorkerExecutor executor) Create a scheduler for aWorkerExecutorobject, actions are executed on the threads of this executor.static SchedulerCreate a scheduler for aContext, actions are executed on the event loop of this context.static SchedulerCreate a scheduler for aVertxobject, actions are executed on the event loop.static <T> WriteStreamObserver<T> toObserver(WriteStream<T> stream) Adapts a Vert.xWriteStreamto an RxJavaObserver.static <R,T> WriteStreamObserver <R> toObserver(WriteStream<T> stream, Function<R, T> mapping) LiketoObserver(WriteStream), except the providedmappingfunction is applied to eachObservableitem.static <T> WriteStreamSubscriber<T> toSubscriber(WriteStream<T> stream) Adapts a Vert.xWriteStreamto an RxJavaSubscriber.static <R,T> WriteStreamSubscriber <R> toSubscriber(WriteStream<T> stream, Function<R, T> mapping) LiketoSubscriber(WriteStream), except the providedmappingfunction is applied to eachFlowableitem.
-
Constructor Details
-
RxHelper
public RxHelper()
-
-
Method Details
-
scheduler
-
scheduler
-
blockingScheduler
-
blockingScheduler
Create a scheduler for aVertxobject, actions can be blocking, they are not executed on Vertx event loop.- Parameters:
vertx- the vertx objectordered- if true then if when tasks are scheduled several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees- Returns:
- the scheduler
-
blockingScheduler
Create a scheduler for aWorkerExecutorobject, actions are executed on the threads of this executor.- Parameters:
executor- the worker executor object- Returns:
- the scheduler
-
toSubscriber
Adapts a Vert.xWriteStreamto an RxJavaSubscriber.After subscription, the original
WriteStreamhandlers should not be used anymore as they will be used by the adapter.- Parameters:
stream- the stream to adapt- Returns:
- the adapted
Subscriber
-
toSubscriber
public static <R,T> WriteStreamSubscriber<R> toSubscriber(WriteStream<T> stream, Function<R, T> mapping) LiketoSubscriber(WriteStream), except the providedmappingfunction is applied to eachFlowableitem. -
toObserver
Adapts a Vert.xWriteStreamto an RxJavaObserver.After subscription, the original
WriteStreamhandlers should not be used anymore as they will be used by the adapter.- Parameters:
stream- the stream to adapt- Returns:
- the adapted
Observer
-
toObserver
LiketoObserver(WriteStream), except the providedmappingfunction is applied to eachObservableitem.
-