Class Redis

java.lang.Object
io.vertx.rxjava3.redis.client.Redis
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate

public class Redis extends Object implements io.vertx.lang.rx.RxDelegate
A simple Redis client.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final io.vertx.lang.rx.TypeArg<Redis> __TYPE_ARG
  • Constructor Details

    • Redis

      public Redis(Redis delegate)
    • Redis

      public Redis(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public Redis getDelegate()
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
    • createClient

      public static Redis createClient(Vertx vertx)
      Create a new Redis client using the default client options.
      Parameters:
      vertx - the vertx instance
      Returns:
      the client
    • createClient

      public static Redis createClient(Vertx vertx, String connectionString)
      Create a new Redis client using the default client options. Does not support rediss (redis over ssl scheme) for now.
      Parameters:
      vertx - the vertx instance
      connectionString - a string URI following the scheme: redis://[username:password@][host][:port][/database]
      Returns:
      the client
    • createClient

      public static Redis createClient(Vertx vertx, RedisOptions options)
      Create a new Redis client using the given client options.
      Parameters:
      vertx - the Vert.x instance
      options - the user provided options
      Returns:
      the client
    • createStandaloneClient

      public static Redis createStandaloneClient(Vertx vertx, RedisOptions options, Supplier<Single<RedisStandaloneConnectOptions>> connectOptions)
      Creates a new standalone Redis client. The options are used to obtain RedisOptions, RedisOptions, RedisOptions and RedisOptions. The connectOptions are queried for every connection attempt.

      If options.getType() != RedisClientType.STANDALONE, an exception is thrown.

      Parameters:
      vertx - the Vert.x instance
      options - the static options
      connectOptions - supplier of the dynamic options
      Returns:
      the standalone client
    • createReplicationClient

      public static Redis createReplicationClient(Vertx vertx, RedisOptions options, Supplier<Single<RedisReplicationConnectOptions>> connectOptions)
      Creates a new replication Redis client. The options are used to obtain RedisOptions, RedisOptions, RedisOptions and RedisOptions. The connectOptions are queried for every connection attempt.

      If options.getType() != RedisClientType.REPLICATION, an exception is thrown.

      Parameters:
      vertx - the Vert.x instance
      options - the static options
      connectOptions - supplier of the dynamic options
      Returns:
      the replication client
    • createSentinelClient

      public static Redis createSentinelClient(Vertx vertx, RedisOptions options, Supplier<Single<RedisSentinelConnectOptions>> connectOptions)
      Creates a new sentinel Redis client. The options are used to obtain RedisOptions, RedisOptions, RedisOptions and RedisOptions. The connectOptions are queried for every connection attempt.

      If options.getType() != RedisClientType.SENTINEL, an exception is thrown.

      Parameters:
      vertx - the Vert.x instance
      options - the static options
      connectOptions - supplier of the dynamic options
      Returns:
      the sentinel client
    • createClusterClient

      public static Redis createClusterClient(Vertx vertx, RedisOptions options, Supplier<Single<RedisClusterConnectOptions>> connectOptions)
      Creates a new cluster Redis client. The options are used to obtain RedisOptions, RedisOptions, RedisOptions and RedisOptions. The connectOptions are queried for every connection attempt.

      If options.getType() != RedisClientType.CLUSTER, an exception is thrown.

      Parameters:
      vertx - the Vert.x instance
      options - the static options
      connectOptions - supplier of the dynamic options
      Returns:
      the cluster client
    • connect

      public Single<RedisConnection> connect()
      Connects to the Redis server.
      Returns:
      a future with the result of the operation
    • rxConnect

      public Single<RedisConnection> rxConnect()
      Connects to the Redis server.
      Returns:
      a future with the result of the operation
    • close

      public Completable close()
      Closes the client and terminates any connection.
      Returns:
    • rxClose

      public Completable rxClose()
      Closes the client and terminates any connection.
      Returns:
    • send

      public Maybe<Response> send(Request command)
      Send the given command to the Redis server or cluster.
      Parameters:
      command - the command to send
      Returns:
      a future with the result of the operation
    • rxSend

      public Maybe<Response> rxSend(Request command)
      Send the given command to the Redis server or cluster.
      Parameters:
      command - the command to send
      Returns:
      a future with the result of the operation
    • batch

      public Single<List<Response>> batch(List<Request> commands)
      Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.
      Parameters:
      commands - list of command to send
      Returns:
      a future with the result of the operation
    • rxBatch

      public Single<List<Response>> rxBatch(List<Request> commands)
      Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.
      Parameters:
      commands - list of command to send
      Returns:
      a future with the result of the operation
    • newInstance

      public static Redis newInstance(Redis arg)