io.vertx.redis.client

## Interface Redis

- All Superinterfaces:
    ReadStream<Response>, StreamBase

      public interface Redis
      extends ReadStream<Response>

  A simple Redis client.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `Redis` | `batch(List<Request> commands, Handler<AsyncResult<List<Response>>> handler)`
    `void` | `close()`
    `Redis` | `connect(Handler<AsyncResult<Redis>> handler)` Connects to the redis server.
    `static Redis` | `createClient(Vertx vertx, RedisOptions options)` Connect to redis, the `onConnect` will get the `Redis` instance.
    `static Redis` | `createClient(Vertx vertx, SocketAddress address)` Connect to redis, the `onConnect` will get the `Redis` instance.
    `Redis` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `Redis` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `Redis` | `fetch(long amount)` Fetch the specified `amount` of elements.
    `Redis` | `handler(Handler<Response> handler)` Set a data handler.
    `Redis` | `pause()` Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.
    `Redis` | `resume()` Resume reading, and sets the buffer in `flowing` mode.
    `Redis` | `send(Request command, Handler<AsyncResult<Response>> onSend)`
    `SocketAddress` | `socketAddress()` Returns the address associated with this client.

    - ### Methods inherited from interface io.vertx.core.streams.ReadStream

      `pipe, pipeTo, pipeTo`

- - ### Method Detail

    - #### createClient

          static Redis createClient(Vertx vertx,
                                    SocketAddress address)

      Connect to redis, the `onConnect` will get the `Redis` instance. This connection will use the default options which are connect to a standalone server on the default port on "localhost".

    - #### createClient

          static Redis createClient(Vertx vertx,
                                    RedisOptions options)

      Connect to redis, the `onConnect` will get the `Redis` instance.

    - #### connect

          Redis connect(Handler<AsyncResult<Redis>> handler)

      Connects to the redis server.
      Parameters:
        `handler` - the async result handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### exceptionHandler

          Redis exceptionHandler(Handler<Throwable> handler)

      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<Response>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          Redis handler(Handler<Response> handler)

      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `ReadStream<Response>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          Redis pause()

      Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.

      While it's paused, no data will be sent to the data `handler`.

      Specified by:
        `pause` in interface `ReadStream<Response>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          Redis resume()

      Resume reading, and sets the buffer in `flowing` mode.

      If the `ReadStream` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `ReadStream<Response>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### fetch

          Redis fetch(long amount)

      Fetch the specified `amount` of elements. If the `ReadStream` has been paused, reading will recommence with the specified `amount` of items, otherwise the specified `amount` will be added to the current stream demand.
      Specified by:
        `fetch` in interface `ReadStream<Response>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          Redis endHandler(Handler<Void> endHandler)

      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<Response>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### send

          Redis send(Request command,
                     Handler<AsyncResult<Response>> onSend)

    - #### batch

          Redis batch(List<Request> commands,
                      Handler<AsyncResult<List<Response>>> handler)

    - #### socketAddress

          SocketAddress socketAddress()

      Returns the address associated with this client.
      Returns:
        the address.

    - #### close

          void close()

Copyright © 2019 Eclipse. All rights reserved.