public class RxHelper extends Object
Constructor and Description |
---|
RxHelper() |
Modifier and Type | Method and Description |
---|---|
static rx.Scheduler |
blockingScheduler(Vertx vertx)
Create a scheduler for a
Vertx object, actions can be blocking, they are not executed
on Vertx event loop. |
static rx.Observable<String> |
deployVerticle(Vertx vertx,
Verticle verticle)
Deploy a verticle you have created yourself, using an
RxJava vertx instance.
|
static rx.Observable<String> |
deployVerticle(Vertx vertx,
Verticle verticle,
DeploymentOptions options)
Like
deployVerticle(Vertx, Verticle) , but DeploymentOptions are provided to configure the
deployment. |
static rx.Observable<HttpClientResponse> |
get(HttpClient client,
int port,
String host,
String requestURI) |
static rx.Observable<HttpClientResponse> |
get(HttpClient client,
int port,
String host,
String requestURI,
MultiMap headers)
Returns an
Observable<HttpClientResponse> that performs a get request each time it is subscribed. |
static rx.Observable<HttpClientResponse> |
get(HttpClient client,
String requestURI) |
static rx.Observable<HttpClientResponse> |
get(HttpClient client,
String host,
String requestURI) |
static rx.Scheduler |
scheduler(Context context)
Create a scheduler for a
Context , actions are executed on the event loop of this context. |
static rx.Scheduler |
scheduler(Vertx vertx)
Create a scheduler for a
Vertx object, actions are executed on the event loop of the current context. |
static rx.Scheduler |
scheduler(WorkerExecutor executor)
Create a scheduler for a
WorkerExecutor object, actions are executed on the threads of this executor. |
static rx.plugins.RxJavaSchedulersHook |
schedulerHook(Context context)
Create a scheduler hook for a
io.vertx.rxjava.core.Context object. |
static rx.plugins.RxJavaSchedulersHook |
schedulerHook(Vertx vertx)
Create a scheduler hook for a
io.vertx.rxjava.core.Vertx object. |
static <T> rx.Observable.Operator<T,Buffer> |
unmarshaller(Class<T> mappedType)
Returns a json unmarshaller for the specified java type as a
Observable.Operator instance.
The marshaller can be used with the Observable.lift(rx.Observable.Operator) method to transform
a Observable<Buffer> into a Observable<T>.
The unmarshaller buffers the content until onComplete is called, then unmarshalling happens.
Note that the returned observable will emit at most a single object. |
public static rx.plugins.RxJavaSchedulersHook schedulerHook(Vertx vertx)
io.vertx.rxjava.core.Vertx
object.vertx
- the vertx objectpublic static rx.plugins.RxJavaSchedulersHook schedulerHook(Context context)
io.vertx.rxjava.core.Context
object.context
- the context objectpublic static rx.Scheduler scheduler(Vertx vertx)
Vertx
object, actions are executed on the event loop of the current context.vertx
- the vertx objectpublic static rx.Scheduler scheduler(WorkerExecutor executor)
WorkerExecutor
object, actions are executed on the threads of this executor.executor
- the worker executor objectpublic static rx.Scheduler scheduler(Context context)
Context
, actions are executed on the event loop of this context.context
- the context objectpublic static rx.Scheduler blockingScheduler(Vertx vertx)
Vertx
object, actions can be blocking, they are not executed
on Vertx event loop.vertx
- the vertx objectpublic static <T> rx.Observable.Operator<T,Buffer> unmarshaller(Class<T> mappedType)
Observable.Operator
instance.
The marshaller can be used with the Observable.lift(rx.Observable.Operator)
method to transform
a Observable<Buffer> into a Observable<T>.
The unmarshaller buffers the content until onComplete is called, then unmarshalling happens.
Note that the returned observable will emit at most a single object.mappedType
- the type to unmarshallpublic static rx.Observable<HttpClientResponse> get(HttpClient client, String requestURI)
public static rx.Observable<HttpClientResponse> get(HttpClient client, String host, String requestURI)
public static rx.Observable<HttpClientResponse> get(HttpClient client, int port, String host, String requestURI)
public static rx.Observable<HttpClientResponse> get(HttpClient client, int port, String host, String requestURI, MultiMap headers)
Observable<HttpClientResponse>
that performs a get request each time it is subscribed. The
returned observable can be used to consume the response.
This is different from the HttpClientRequest#toObservable()
that should be subscribed before the request is ended
and should be consumed immediatly and once.
client
- the http clientport
- the remote porthost
- the remote hostrequestURI
- the request URIheaders
- the request headerspublic static rx.Observable<String> deployVerticle(Vertx vertx, Verticle verticle)
vertx
- the vertx instanceverticle
- the verticle instance to deploypublic static rx.Observable<String> deployVerticle(Vertx vertx, Verticle verticle, DeploymentOptions options)
deployVerticle(Vertx, Verticle)
, but DeploymentOptions
are provided to configure the
deployment.vertx
- the vertx instanceverticle
- the verticle instance to deployoptions
- the deployment options.Copyright © 2018. All rights reserved.