Package io.lettuce.core
Class XReadArgs
- java.lang.Object
-
- io.lettuce.core.XReadArgs
-
- All Implemented Interfaces:
CompositeArgument
public class XReadArgs extends Object implements CompositeArgument
Argument list builder for the Redis XREAD and XREADGROUP commands. Static import the methods fromXReadArgs.Builder
and call the methods:block(…)
.XReadArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 5.1
- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XReadArgs.Builder
Builder entry points forXReadArgs
.static class
XReadArgs.StreamOffset<K>
Value object representing a Stream with its offset.
-
Constructor Summary
Constructors Constructor Description XReadArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XReadArgs
block(long milliseconds)
Perform a blocking read and wait up tomilliseconds
for a new stream message.XReadArgs
block(Duration timeout)
Perform a blocking read and wait up to atimeout
for a new stream message.<K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.XReadArgs
count(long count)
Limit read tocount
messages.XReadArgs
noack(boolean noack)
Use NOACK option to disable auto-acknowledgement.
-
-
-
Method Detail
-
block
public XReadArgs block(long milliseconds)
Perform a blocking read and wait up tomilliseconds
for a new stream message.- Parameters:
milliseconds
- max time to wait.- Returns:
this
.
-
block
public XReadArgs block(Duration timeout)
Perform a blocking read and wait up to atimeout
for a new stream message.- Parameters:
timeout
- max time to wait.- Returns:
this
.
-
count
public XReadArgs count(long count)
Limit read tocount
messages.- Parameters:
count
- number of messages.- Returns:
this
.
-
noack
public XReadArgs noack(boolean noack)
Use NOACK option to disable auto-acknowledgement. Only valid for XREADGROUP.- Parameters:
noack
-true
to disable auto-ack.- Returns:
this
.
-
build
public <K,V> void build(CommandArgs<K,V> args)
Description copied from interface:CompositeArgument
Build command arguments and contribute arguments toCommandArgs
.Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
- Specified by:
build
in interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-