Class Redis


  • public class Redis
    extends Object
    A simple Redis client.

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

    • Field Detail

    • Constructor Detail

      • Redis

        public Redis​(io.vertx.redis.client.Redis delegate)
      • Redis

        public Redis​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.redis.client.Redis getDelegate()
      • hashCode

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

        public static Redis createClient​(Vertx vertx)
        Parameters:
        vertx - the vertx instance
        Returns:
        the client
      • createClient

        public static Redis createClient​(Vertx vertx,
                                         String connectionString)
        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,
                                         io.vertx.redis.client.RedisOptions options)
        Parameters:
        vertx - the vertx instance
        options - the user provided options
        Returns:
        the client
      • 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. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • connectAndAwait

        public RedisConnection connectAndAwait()
        Blocking variant of connect().

        This method waits 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 RedisConnection instance produced by the operation.
      • connectAndForget

        public Redis connectAndForget()
        Variant of connect() that ignores the result of the operation.

        This method subscribes on the result of connect(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from connect() but you don't need to compose it with other operations.

        Returns:
        the instance of Redis to chain method calls.
      • close

        public void close()
      • send

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

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        command - the command to send
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • sendAndAwait

        public Response sendAndAwait​(Request command)
        Blocking variant of send(io.vertx.mutiny.redis.client.Request).

        This method waits 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 Response instance produced by the operation.
      • batch

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<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.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        commands - list of command to send
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • batchAndAwait

        public List<Response> batchAndAwait​(List<Request> commands)
        Blocking variant of batch(List).

        This method waits 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 List instance produced by the operation.
      • batchAndForget

        public Redis batchAndForget​(List<Request> commands)
        Variant of batch(List) that ignores the result of the operation.

        This method subscribes on the result of batch(List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from batch(List) but you don't need to compose it with other operations.

        Parameters:
        commands - list of command to send
        Returns:
        the instance of Redis to chain method calls.
      • newInstance

        public static Redis newInstance​(io.vertx.redis.client.Redis arg)