Package io.vertx.rxjava3
Class RxHelper
- java.lang.Object
-
- io.vertx.rxjava3.RxHelper
-
public class RxHelper extends Object
- Author:
- Julien Viet
-
-
Constructor Summary
Constructors Constructor Description RxHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Scheduler
blockingScheduler(Vertx vertx)
Create a scheduler for aVertx
object, actions can be blocking, they are not executed on Vertx event loop.static Scheduler
blockingScheduler(Vertx vertx, boolean ordered)
Create a scheduler for aVertx
object, actions can be blocking, they are not executed on Vertx event loop.static Scheduler
blockingScheduler(WorkerExecutor executor)
Create a scheduler for aWorkerExecutor
object, actions are executed on the threads of this executor.static Scheduler
scheduler(Context context)
Create a scheduler for aContext
, actions are executed on the event loop of this context.static Scheduler
scheduler(Vertx vertx)
Create a scheduler for aVertx
object, actions are executed on the event loop.static <T> WriteStreamObserver<T>
toObserver(WriteStream<T> stream)
Adapts a Vert.xWriteStream
to an RxJavaObserver
.static <R,T>
WriteStreamObserver<R>toObserver(WriteStream<T> stream, java.util.function.Function<R,T> mapping)
LiketoObserver(WriteStream)
, except the providedmapping
function is applied to eachObservable
item.static <T> WriteStreamSubscriber<T>
toSubscriber(WriteStream<T> stream)
Adapts a Vert.xWriteStream
to an RxJavaSubscriber
.static <R,T>
WriteStreamSubscriber<R>toSubscriber(WriteStream<T> stream, java.util.function.Function<R,T> mapping)
LiketoSubscriber(WriteStream)
, except the providedmapping
function is applied to eachFlowable
item.
-
-
-
Method Detail
-
scheduler
public static Scheduler scheduler(Vertx vertx)
Create a scheduler for aVertx
object, actions are executed on the event loop.- Parameters:
vertx
- the vertx object- Returns:
- the scheduler
-
scheduler
public static Scheduler scheduler(Context context)
Create a scheduler for aContext
, actions are executed on the event loop of this context.- Parameters:
context
- the context object- Returns:
- the scheduler
-
blockingScheduler
public static Scheduler blockingScheduler(Vertx vertx)
Create a scheduler for aVertx
object, actions can be blocking, they are not executed on Vertx event loop.- Parameters:
vertx
- the vertx object- Returns:
- the scheduler
-
blockingScheduler
public static Scheduler blockingScheduler(Vertx vertx, boolean ordered)
Create a scheduler for aVertx
object, 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
public static Scheduler blockingScheduler(WorkerExecutor executor)
Create a scheduler for aWorkerExecutor
object, actions are executed on the threads of this executor.- Parameters:
executor
- the worker executor object- Returns:
- the scheduler
-
toSubscriber
public static <T> WriteStreamSubscriber<T> toSubscriber(WriteStream<T> stream)
Adapts a Vert.xWriteStream
to an RxJavaSubscriber
.After subscription, the original
WriteStream
handlers 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, java.util.function.Function<R,T> mapping)
LiketoSubscriber(WriteStream)
, except the providedmapping
function is applied to eachFlowable
item.
-
toObserver
public static <T> WriteStreamObserver<T> toObserver(WriteStream<T> stream)
Adapts a Vert.xWriteStream
to an RxJavaObserver
.After subscription, the original
WriteStream
handlers should not be used anymore as they will be used by the adapter.- Parameters:
stream
- the stream to adapt- Returns:
- the adapted
Observer
-
toObserver
public static <R,T> WriteStreamObserver<R> toObserver(WriteStream<T> stream, java.util.function.Function<R,T> mapping)
LiketoObserver(WriteStream)
, except the providedmapping
function is applied to eachObservable
item.
-
-