public interface Redis extends ReadStream<Response>
| Modifier and Type | Method and Description |
|---|---|
default Future<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.
|
Redis |
batch(List<Request> commands,
Handler<AsyncResult<List<Response>>> onSend)
Sends a list of commands in a single IO operation, this prevents any inter twinning to happen from other
client users.
|
void |
close() |
default Future<Redis> |
connect()
Connects to the redis server.
|
Redis |
connect(Handler<AsyncResult<Redis>> handler)
Connects to the redis server.
|
static Redis |
createClient(Vertx vertx,
RedisOptions options)
Connect to redis, the
onConnect will get the Redis instance. |
static Redis |
createClient(Vertx vertx,
String address)
Connect to redis, the
onConnect will get the Redis instance. |
Redis |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
Redis |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.
|
Redis |
fetch(long amount)
Fetch the specified
amount of elements. |
Redis |
handler(Handler<Response> handler)
Set a data handler.
|
Redis |
pause()
Pause the
ReadStream, it sets the buffer in fetch mode and clears the actual demand. |
Redis |
resume()
Resume reading, and sets the buffer in
flowing mode. |
default Future<Response> |
send(Request command)
Send the given command to the redis server or cluster.
|
Redis |
send(Request command,
Handler<AsyncResult<Response>> onSend)
Send the given command to the redis server or cluster.
|
String |
socketAddress()
Returns the address associated with this client.
|
pipe, pipeTo, pipeTostatic Redis createClient(Vertx vertx, String address)
onConnect will get the Redis instance.
This connection will use the default options which are connect
to a standalone server on the default port on "localhost".static Redis createClient(Vertx vertx, RedisOptions options)
onConnect will get the Redis instance.Redis connect(Handler<AsyncResult<Redis>> handler)
handler - the async result handlerdefault Future<Redis> connect()
Redis exceptionHandler(Handler<Throwable> handler)
exceptionHandler in interface ReadStream<Response>exceptionHandler in interface StreamBasehandler - the exception handlerRedis handler(Handler<Response> handler)
handler in interface ReadStream<Response>Redis pause()
ReadStream, it sets the buffer in fetch mode and clears the actual demand.
While it's paused, no data will be sent to the data handler.
pause in interface ReadStream<Response>Redis resume()
flowing mode.
If the ReadStream has been paused, reading will recommence on it.resume in interface ReadStream<Response>Redis fetch(long amount)
amount of elements. If the ReadStream has been paused, reading will
recommence with the specified amount of items, otherwise the specified amount will
be added to the current stream demand.fetch in interface ReadStream<Response>Redis endHandler(Handler<Void> endHandler)
endHandler in interface ReadStream<Response>Redis send(Request command, Handler<AsyncResult<Response>> onSend)
command - the command to sendonSend - the asynchronous result handler.default Future<Response> send(Request command)
command - the command to sendRedis batch(List<Request> commands, Handler<AsyncResult<List<Response>>> onSend)
commands - list of command to sendonSend - the asynchronous result handler.default Future<List<Response>> batch(List<Request> commands)
commands - list of command to sendString socketAddress()
void close()
Copyright © 2019 Eclipse. All rights reserved.