io.vertx.rxjava.core

## Class RxHelper

- java.lang.Object
- - io.vertx.rxjava.core.RxHelper

-     public class RxHelper
      extends Object

  A set of helpers for RxJava and Vert.x.
  Author:
    Julien Viet

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RxHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    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 Observable<String>` | `deployVerticle(Vertx vertx, Verticle verticle)` Deploy a verticle you have created yourself, using an RxJava vertx instance.
    `static Observable<String>` | `deployVerticle(Vertx vertx, Verticle verticle, DeploymentOptions options)` Like `deployVerticle(Vertx, Verticle)`, but `DeploymentOptions` are provided to configure the deployment.
    `static Observable<HttpClientResponse>` | `get(HttpClient client, int port, String host, String requestURI)`
    `static 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 Observable<HttpClientResponse>` | `get(HttpClient client, String requestURI)`
    `static Observable<HttpClientResponse>` | `get(HttpClient client, String host, String requestURI)`
    `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 of the current context.
    `static Scheduler` | `scheduler(WorkerExecutor executor)` Create a scheduler for a `WorkerExecutor` object, actions are executed on the threads of this executor.
    `static RxJavaSchedulersHook` | `schedulerHook(Context context)` Create a scheduler hook for a `Context` object.
    `static RxJavaSchedulersHook` | `schedulerHook(Vertx vertx)` Create a scheduler hook for a `Vertx` object.
    `static <T> 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RxHelper

          public RxHelper()

  - ### Method Detail

    - #### schedulerHook

          public static RxJavaSchedulersHook schedulerHook(Vertx vertx)

      Create a scheduler hook for a `Vertx` object.
      Parameters:
        `vertx` - the vertx object
      Returns:
        the scheduler hook

    - #### schedulerHook

          public static RxJavaSchedulersHook schedulerHook(Context context)

      Create a scheduler hook for a `Context` object.
      Parameters:
        `context` - the context object
      Returns:
        the scheduler hook

    - #### scheduler

          public static Scheduler scheduler(Vertx vertx)

      Create a scheduler for a `Vertx` object, actions are executed on the event loop of the current context.
      Parameters:
        `vertx` - the vertx object
      Returns:
        the scheduler

    - #### scheduler

          public static Scheduler scheduler(WorkerExecutor executor)

      Create a scheduler for a `WorkerExecutor` object, actions are executed on the threads of this executor.
      Parameters:
        `executor` - the worker executor object
      Returns:
        the scheduler

    - #### scheduler

          public static Scheduler scheduler(Context context)

      Create a scheduler for a `Context`, 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 a `Vertx` 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 a `Vertx` object, actions can be blocking, they are not executed on Vertx event loop.
      Parameters:
        `vertx` - the vertx object
        `ordered` - 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

    - #### unmarshaller

          public static <T> 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.
      Parameters:
        `mappedType` - the type to unmarshall
      Returns:
        the unmarshaller operator

    - #### get

          public static Observable<HttpClientResponse> get(HttpClient client,
                                                           String requestURI)

      See Also:
        `get(HttpClient, int, String, String, MultiMap)`

    - #### get

          public static Observable<HttpClientResponse> get(HttpClient client,
                                                           String host,
                                                           String requestURI)

      See Also:
        `get(HttpClient, int, String, String, MultiMap)`

    - #### get

          public static Observable<HttpClientResponse> get(HttpClient client,
                                                           int port,
                                                           String host,
                                                           String requestURI)

      See Also:
        `get(HttpClient, int, String, String, MultiMap)`

    - #### get

          public static 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. 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.

      Parameters:
        `client` - the http client
        `port` - the remote port
        `host` - the remote host
        `requestURI` - the request URI
        `headers` - the request headers
      Returns:
        the response observable

    - #### deployVerticle

          public static Observable<String> deployVerticle(Vertx vertx,
                                                          Verticle verticle)

      Deploy a verticle you have created yourself, using an RxJava vertx instance.
      Parameters:
        `vertx` - the vertx instance
        `verticle` - the verticle instance to deploy
      Returns:
        the response observable

    - #### deployVerticle

          public static Observable<String> deployVerticle(Vertx vertx,
                                                          Verticle verticle,
                                                          DeploymentOptions options)

      Like `deployVerticle(Vertx, Verticle)`, but `DeploymentOptions` are provided to configure the deployment.
      Parameters:
        `vertx` - the vertx instance
        `verticle` - the verticle instance to deploy
        `options` - the deployment options.
      Returns:
        the response observable

Copyright © 2018 Eclipse. All rights reserved.