public class RxHelper extends Object
Constructor and Description |
---|
RxHelper() |
Modifier and Type | Method and Description |
---|---|
static Scheduler |
blockingScheduler(Vertx vertx)
Create a scheduler for a
Vertx object, actions can be blocking, they are not executed
on Vertx event loop. |
static Scheduler |
blockingScheduler(Vertx vertx,
boolean ordered)
Create a scheduler for a
Vertx object, actions can be blocking, they are not executed
on Vertx event loop. |
static Scheduler |
blockingScheduler(WorkerExecutor executor)
Create a scheduler for a
WorkerExecutor object, actions are executed on the threads of this executor. |
static Scheduler |
scheduler(Context context)
Create a scheduler for a
Context , actions are executed on the event loop of this context. |
static Scheduler |
scheduler(Vertx vertx)
Create a scheduler for a
Vertx object, actions are executed on the event loop. |
static <T> WriteStreamObserver<T> |
toObserver(WriteStream<T> stream)
Adapts a Vert.x
WriteStream to an RxJava Observer . |
static <R,T> WriteStreamObserver<R> |
toObserver(WriteStream<T> stream,
java.util.function.Function<R,T> mapping)
Like
toObserver(WriteStream) , except the provided mapping function is applied to each Observable item. |
static <T> WriteStreamSubscriber<T> |
toSubscriber(WriteStream<T> stream)
Adapts a Vert.x
WriteStream to an RxJava Subscriber . |
static <R,T> WriteStreamSubscriber<R> |
toSubscriber(WriteStream<T> stream,
java.util.function.Function<R,T> mapping)
Like
toSubscriber(WriteStream) , except the provided mapping function is applied to each Flowable item. |
public static Scheduler scheduler(Vertx vertx)
Vertx
object, actions are executed on the event loop.vertx
- the vertx objectpublic static Scheduler scheduler(Context context)
Context
, actions are executed on the event loop of this context.context
- the context objectpublic static Scheduler blockingScheduler(Vertx vertx)
Vertx
object, actions can be blocking, they are not executed
on Vertx event loop.vertx
- the vertx objectpublic static Scheduler blockingScheduler(Vertx vertx, boolean ordered)
Vertx
object, actions can be blocking, they are not executed
on Vertx event loop.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
guaranteespublic static Scheduler blockingScheduler(WorkerExecutor executor)
WorkerExecutor
object, actions are executed on the threads of this executor.executor
- the worker executor objectpublic static <T> WriteStreamSubscriber<T> toSubscriber(WriteStream<T> stream)
WriteStream
to an RxJava Subscriber
.
After subscription, the original WriteStream
handlers should not be used anymore as they will be used by the adapter.
stream
- the stream to adaptSubscriber
public static <R,T> WriteStreamSubscriber<R> toSubscriber(WriteStream<T> stream, java.util.function.Function<R,T> mapping)
toSubscriber(WriteStream)
, except the provided mapping
function is applied to each Flowable
item.public static <T> WriteStreamObserver<T> toObserver(WriteStream<T> stream)
WriteStream
to an RxJava Observer
.
After subscription, the original WriteStream
handlers should not be used anymore as they will be used by the adapter.
stream
- the stream to adaptObserver
public static <R,T> WriteStreamObserver<R> toObserver(WriteStream<T> stream, java.util.function.Function<R,T> mapping)
toObserver(WriteStream)
, except the provided mapping
function is applied to each Observable
item.Copyright © 2024 Eclipse. All rights reserved.