Class Redis
- java.lang.Object
-
- io.vertx.mutiny.redis.client.Redis
-
public class Redis extends Object
A simple Redis client. NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<Redis>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.List<Response>
batchAndAwait(List<Request> commands)
Blocking variant ofio.vertx.mutiny.redis.client.Redis#batch(List
.) Redis
batchAndForget(List<Request> commands)
Variant ofio.vertx.mutiny.redis.client.Redis#batch(List
that ignores the result of the operation.) void
close()
io.smallrye.mutiny.Uni<RedisConnection>
connect()
Connects to the redis server.RedisConnection
connectAndAwait()
Blocking variant ofconnect()
.Redis
connectAndForget()
Variant ofconnect()
that ignores the result of the operation.static Redis
createClient(Vertx vertx)
static Redis
createClient(Vertx vertx, io.vertx.redis.client.RedisOptions options)
static Redis
createClient(Vertx vertx, String connectionString)
boolean
equals(Object o)
io.vertx.redis.client.Redis
getDelegate()
int
hashCode()
static Redis
newInstance(io.vertx.redis.client.Redis arg)
io.smallrye.mutiny.Uni<Response>
send(Request command)
Send the given command to the redis server or cluster.Response
sendAndAwait(Request command)
Blocking variant ofsend(io.vertx.mutiny.redis.client.Request)
.Redis
sendAndForget(Request command)
Variant ofsend(io.vertx.mutiny.redis.client.Request)
that ignores the result of the operation.String
toString()
-
-
-
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()
-
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 instanceconnectionString
- 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 instanceoptions
- the user provided options- Returns:
- the client
-
connect
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 ofconnect()
.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 ofconnect()
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 fromconnect()
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
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 ofsend(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 Redis sendAndForget(Request command)
Variant ofsend(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 fromsend(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 Redis to chain method calls.
-
batch
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 ofio.vertx.mutiny.redis.client.Redis#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 ofio.vertx.mutiny.redis.client.Redis#batch(List
that ignores the result of the operation.) This method subscribes on the result of
io.vertx.mutiny.redis.client.Redis#batch(List
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from) io.vertx.mutiny.redis.client.Redis#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)
-
-