Class Redis

java.lang.Object
io.vertx.mutiny.redis.client.Redis
All Implemented Interfaces:
MutinyDelegate

public class Redis extends Object implements MutinyDelegate
A simple Redis client.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • Redis
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeArg<Redis>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Redis(io.vertx.redis.client.Redis delegate)
    Create a new instance of Redis delegating to the given (non-null) instance of Redis.
    Redis(Object delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.smallrye.mutiny.Uni<List<io.vertx.redis.client.Response>>
    batch(List<io.vertx.redis.client.Request> commands)
    Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.
    List<io.vertx.redis.client.Response>
    batchAndAwait(List<io.vertx.redis.client.Request> commands)
    Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.
    batchAndForget(List<io.vertx.redis.client.Request> commands)
    Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.
    io.smallrye.mutiny.Uni<Void>
    Closes the client and terminates any connection.
    void
    Closes the client and terminates any connection.
    Closes the client and terminates any connection.
    io.smallrye.mutiny.Uni<RedisConnection>
    Connects to the Redis server.
    Connects to the Redis server.
    Connects to the Redis server.
    static Redis
    Create a new Redis client using the default client options.
    static Redis
    createClient(Vertx vertx, io.vertx.redis.client.RedisOptions options)
    Create a new Redis client using the given client options.
    static Redis
    createClient(Vertx vertx, String connectionString)
    Create a new Redis client using the default client options.
    static Redis
    createClusterClient(Vertx vertx, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisClusterConnectOptions>> connectOptions)
    Creates a new cluster Redis client.
    static Redis
    createReplicationClient(Vertx vertx, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisReplicationConnectOptions>> connectOptions)
    Creates a new replication Redis client.
    static Redis
    createSentinelClient(Vertx vertx, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisSentinelConnectOptions>> connectOptions)
    Creates a new sentinel Redis client.
    static Redis
    createStandaloneClient(Vertx vertx, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisStandaloneConnectOptions>> connectOptions)
    Creates a new standalone Redis client.
    boolean
     
    io.vertx.redis.client.Redis
    Get the delegate instance.
    int
     
    static Redis
    newInstance(io.vertx.redis.client.Redis delegate)
    Creates a new instance of the Redis.
    io.smallrye.mutiny.Uni<io.vertx.redis.client.Response>
    send(io.vertx.redis.client.Request command)
    Send the given command to the Redis server or cluster.
    io.vertx.redis.client.Response
    sendAndAwait(io.vertx.redis.client.Request command)
    Send the given command to the Redis server or cluster.
    sendAndForget(io.vertx.redis.client.Request command)
    Send the given command to the Redis server or cluster.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • __TYPE_ARG

      public static final TypeArg<Redis> __TYPE_ARG
  • Constructor Details

    • Redis

      public Redis(io.vertx.redis.client.Redis delegate)
      Create a new instance of Redis delegating to the given (non-null) instance of Redis.
    • Redis

      public Redis(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.redis.client.Redis getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • connect

      @CheckReturnValue public io.smallrye.mutiny.Uni<RedisConnection> connect()
      Connects to the Redis server.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • Redis.connect()
    • connectAndAwait

      public RedisConnection connectAndAwait()
      Connects to the Redis server.

      Unlike the bare Vert.x variant, this method returns a RedisConnection. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • Redis.connect()
    • connectAndForget

      public Redis connectAndForget()
      Connects to the Redis server.

      Unlike the bare Vert.x variant, this method ignores the RedisConnection result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • Redis.connect()
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Closes the client and terminates any connection.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • Redis.close()
    • closeAndAwait

      public void closeAndAwait()
      Closes the client and terminates any connection.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • Redis.close()
    • closeAndForget

      public Redis closeAndForget()
      Closes the client and terminates any connection.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • Redis.close()
    • send

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.redis.client.Response> send(io.vertx.redis.client.Request command)
      Send the given command to the Redis server or cluster.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      command - the command to send
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • Redis.send(Request)
    • sendAndAwait

      public io.vertx.redis.client.Response sendAndAwait(io.vertx.redis.client.Request command)
      Send the given command to the Redis server or cluster.

      Unlike the bare Vert.x variant, this method returns a Response. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      command - the command to send
      Returns:
      The operation result
      See Also:
      • Redis.send(Request)
    • sendAndForget

      public Redis sendAndForget(io.vertx.redis.client.Request command)
      Send the given command to the Redis server or cluster.

      Unlike the bare Vert.x variant, this method ignores the Response result or any failure.

      Parameters:
      command - the command to send
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • Redis.send(Request)
    • batch

      @CheckReturnValue public io.smallrye.mutiny.Uni<List<io.vertx.redis.client.Response>> batch(List<io.vertx.redis.client.Request> commands)
      Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      commands - list of command to send
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • Redis.batch(List)
    • batchAndAwait

      public List<io.vertx.redis.client.Response> batchAndAwait(List<io.vertx.redis.client.Request> commands)
      Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.

      Unlike the bare Vert.x variant, this method returns a List<io.vertx.redis.client.Response>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      commands - list of command to send
      Returns:
      The operation result
      See Also:
      • Redis.batch(List)
    • batchAndForget

      public Redis batchAndForget(List<io.vertx.redis.client.Request> commands)
      Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other client users.

      Unlike the bare Vert.x variant, this method ignores the List<io.vertx.redis.client.Response> result or any failure.

      Parameters:
      commands - list of command to send
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • Redis.batch(List)
    • 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:
      connectionString - a string URI following the scheme: redis://[username:password@][host][:port][/database]
      vertx - the vertx instance
      Returns:
      the client
      See Also:
    • createClient

      public static Redis createClient(Vertx vertx, io.vertx.redis.client.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, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisStandaloneConnectOptions>> connectOptions)
      Creates a new standalone Redis client. The options are used to obtain RedisOptions.getType(), RedisOptions.getNetClientOptions(), RedisOptions.getPoolOptions() and RedisOptions.getTracingPolicy(). 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, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisReplicationConnectOptions>> connectOptions)
      Creates a new replication Redis client. The options are used to obtain RedisOptions.getType(), RedisOptions.getNetClientOptions(), RedisOptions.getPoolOptions() and RedisOptions.getTracingPolicy(). 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, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisSentinelConnectOptions>> connectOptions)
      Creates a new sentinel Redis client. The options are used to obtain RedisOptions.getType(), RedisOptions.getNetClientOptions(), RedisOptions.getPoolOptions() and RedisOptions.getTracingPolicy(). 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, io.vertx.redis.client.RedisOptions options, Supplier<io.smallrye.mutiny.Uni<io.vertx.redis.client.RedisClusterConnectOptions>> connectOptions)
      Creates a new cluster Redis client. The options are used to obtain RedisOptions.getType(), RedisOptions.getNetClientOptions(), RedisOptions.getPoolOptions() and RedisOptions.getTracingPolicy(). 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
    • newInstance

      public static Redis newInstance(io.vertx.redis.client.Redis delegate)
      Creates a new instance of the Redis.
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object