Class RedisConnection

java.lang.Object
io.vertx.mutiny.redis.client.RedisConnection
All Implemented Interfaces:
MutinyDelegate, ReadStream<Response>, StreamBase

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

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

  • Field Details

  • Constructor Details

    • RedisConnection

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

      public RedisConnection(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.redis.client.RedisConnection getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface ReadStream<Response>
      Specified by:
      getDelegate in interface StreamBase
      Returns:
      the delegate used by this Mutiny object of generated type
    • 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
    • pipe

      public Pipe<Response> pipe()
      Specified by:
      pipe in interface ReadStream<Response>
      Returns:
      a pipe
    • 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.
    • pipeToAndAwait

      public Void pipeToAndAwait(WriteStream<Response> dst)
      Description copied from interface: ReadStream
      Blocking variant of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream).

      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).

      Specified by:
      pipeToAndAwait in interface ReadStream<Response>
      Parameters:
      dst - the destination write stream
      Returns:
      the Void instance produced by the operation.
    • pipeToAndForget

      public void pipeToAndForget(WriteStream<Response> dst)
      Description copied from interface: ReadStream
      Variant of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream) that ignores the result of the operation.

      This method subscribes on the result of ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream) but you don't need to compose it with other operations.

      Specified by:
      pipeToAndForget in interface ReadStream<Response>
      Parameters:
      dst - the destination write stream
    • exceptionHandler

      public RedisConnection exceptionHandler(Consumer<Throwable> handler)
      Specified by:
      exceptionHandler in interface ReadStream<Response>
      Specified by:
      exceptionHandler in interface StreamBase
      Parameters:
      handler -
      Returns:
    • handler

      public RedisConnection handler(Consumer<Response> handler)
      Specified by:
      handler in interface ReadStream<Response>
      Parameters:
      handler -
      Returns:
    • pause

      public RedisConnection pause()
      Specified by:
      pause in interface ReadStream<Response>
      Returns:
      the instance of RedisConnection to chain method calls.
    • resume

      public RedisConnection resume()
      Specified by:
      resume in interface ReadStream<Response>
      Returns:
      the instance of RedisConnection to chain method calls.
    • fetch

      public RedisConnection fetch(long amount)
      Specified by:
      fetch in interface ReadStream<Response>
      Parameters:
      amount -
      Returns:
      the instance of RedisConnection to chain method calls.
    • endHandler

      public RedisConnection endHandler(Runnable endHandler)
      Specified by:
      endHandler in interface ReadStream<Response>
      Parameters:
      endHandler -
      Returns:
    • 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.
    • sendAndForget

      public RedisConnection sendAndForget(Request command)
      Variant of send(io.vertx.mutiny.redis.client.Request) that ignores the result of the operation.

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

      Parameters:
      command - the command to send
      Returns:
      the instance of RedisConnection to chain method calls.
    • 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.
    • toMulti

      @CheckReturnValue public io.smallrye.mutiny.Multi<Response> toMulti()
      Specified by:
      toMulti in interface ReadStream<Response>
    • toBlockingIterable

      public Iterable<Response> toBlockingIterable()
    • toBlockingStream

      public Stream<Response> toBlockingStream()
    • newInstance

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