Class RedisConnection

  • All Implemented Interfaces:
    ReadStream<Response>, StreamBase

    public class RedisConnection
    extends Object
    implements ReadStream<Response>
    A simple Redis client.

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

    • Constructor Detail

      • RedisConnection

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

        public RedisConnection​(Object delegate)
    • Method Detail

      • hashCode

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

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> pipeTo​(WriteStream<Response> dst)
        Description copied from interface: ReadStream
        Pipe this ReadStream to the WriteStream.

        Elements emitted by this stream will be written to the write stream until this stream ends or fails.

        Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result.

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

        Specified by:
        pipeTo in interface ReadStream<Response>
        Parameters:
        dst - the destination write stream
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • fetch

        public RedisConnection fetch​(long amount)
        Specified by:
        fetch in interface ReadStream<Response>
        Parameters:
        amount -
        Returns:
        the instance of RedisConnection to chain method calls.
      • 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 RedisConnection 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 RedisConnection to chain method calls.
      • close

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> close()
        Closes the connection or returns to the pool.

        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.
      • closeAndAwait

        public Void closeAndAwait()
        Blocking variant of close().

        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 Void instance produced by the operation.
      • closeAndForget

        public RedisConnection closeAndForget()
        Variant of close() that ignores the result of the operation.

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

        Returns:
        the instance of RedisConnection to chain method calls.
      • pendingQueueFull

        public boolean pendingQueueFull()
        Returns:
        true is queue is full.
      • newInstance

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