public interface Redis extends ReadStream<Response>
Modifier and Type | Method and Description |
---|---|
Redis |
batch(List<Request> commands,
Handler<AsyncResult<List<Response>>> handler) |
void |
close() |
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,
SocketAddress 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. |
Redis |
send(Request command,
Handler<AsyncResult<Response>> onSend) |
SocketAddress |
socketAddress()
Returns the address associated with this client.
|
pipe, pipeTo, pipeTo
static Redis createClient(Vertx vertx, SocketAddress 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 handlerRedis exceptionHandler(Handler<Throwable> handler)
exceptionHandler
in interface ReadStream<Response>
exceptionHandler
in interface StreamBase
handler
- 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)
SocketAddress socketAddress()
void close()
Copyright © 2019 Eclipse. All rights reserved.