Class RedisConnection
- java.lang.Object
-
- io.vertx.mutiny.redis.client.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 theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<RedisConnection>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description RedisConnection(io.vertx.redis.client.RedisConnection delegate)
RedisConnection(Object delegate)
-
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 ofbatch(List)
.RedisConnection
batchAndForget(List<Request> commands)
Variant ofbatch(List)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
close()
Closes the connection or returns to the pool.Void
closeAndAwait()
Blocking variant ofclose()
.RedisConnection
closeAndForget()
Variant ofclose()
that ignores the result of the operation.RedisConnection
endHandler(Runnable endHandler)
boolean
equals(Object o)
RedisConnection
exceptionHandler(Consumer<Throwable> handler)
RedisConnection
fetch(long amount)
io.vertx.redis.client.RedisConnection
getDelegate()
RedisConnection
handler(Consumer<Response> handler)
int
hashCode()
static RedisConnection
newInstance(io.vertx.redis.client.RedisConnection arg)
RedisConnection
pause()
boolean
pendingQueueFull()
Pipe<Response>
pipe()
io.smallrye.mutiny.Uni<Void>
pipeTo(WriteStream<Response> dst)
Pipe thisReadStream
to theWriteStream
.Void
pipeToAndAwait(WriteStream<Response> dst)
Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
.void
pipeToAndForget(WriteStream<Response> dst)
Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
that ignores the result of the operation.RedisConnection
resume()
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)
.RedisConnection
sendAndForget(Request command)
Variant ofsend(io.vertx.mutiny.redis.client.Request)
that ignores the result of the operation.Iterable<Response>
toBlockingIterable()
Stream<Response>
toBlockingStream()
io.smallrye.mutiny.Multi<Response>
toMulti()
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<RedisConnection> __TYPE_ARG
-
-
Constructor Detail
-
RedisConnection
public RedisConnection(io.vertx.redis.client.RedisConnection delegate)
-
RedisConnection
public RedisConnection(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.redis.client.RedisConnection getDelegate()
- Specified by:
getDelegate
in interfaceReadStream<Response>
- Specified by:
getDelegate
in interfaceStreamBase
-
pipe
public Pipe<Response> pipe()
- Specified by:
pipe
in interfaceReadStream<Response>
- Returns:
- a pipe
-
pipeTo
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<Response> dst)
Description copied from interface:ReadStream
Pipe thisReadStream
to theWriteStream
.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 interfaceReadStream<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 ofReadStream.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 interfaceReadStream<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 ofReadStream.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 fromReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
but you don't need to compose it with other operations.- Specified by:
pipeToAndForget
in interfaceReadStream<Response>
- Parameters:
dst
- the destination write stream
-
exceptionHandler
public RedisConnection exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandler
in interfaceReadStream<Response>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Parameters:
handler
-- Returns:
-
handler
public RedisConnection handler(Consumer<Response> handler)
- Specified by:
handler
in interfaceReadStream<Response>
- Parameters:
handler
-- Returns:
-
pause
public RedisConnection pause()
- Specified by:
pause
in interfaceReadStream<Response>
- Returns:
- the instance of RedisConnection to chain method calls.
-
resume
public RedisConnection resume()
- Specified by:
resume
in interfaceReadStream<Response>
- Returns:
- the instance of RedisConnection to chain method calls.
-
fetch
public RedisConnection fetch(long amount)
- Specified by:
fetch
in interfaceReadStream<Response>
- Parameters:
amount
-- Returns:
- the instance of RedisConnection to chain method calls.
-
endHandler
public RedisConnection endHandler(Runnable endHandler)
- Specified by:
endHandler
in interfaceReadStream<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 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 RedisConnection 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 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 ofbatch(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 ofbatch(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 frombatch(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 ofclose()
.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 ofclose()
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 fromclose()
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 interfaceReadStream<Response>
-
newInstance
public static RedisConnection newInstance(io.vertx.redis.client.RedisConnection arg)
-
-