public class XReadArgs extends Object implements CompositeArgument
XReadArgs.Builder and call the methods: block(…) .
XReadArgs is a mutable object and instances should be used only once to avoid shared mutable state.
| Modifier and Type | Class and Description |
|---|---|
static class |
XReadArgs.Builder
Builder entry points for
XReadArgs. |
static class |
XReadArgs.StreamOffset<K>
Value object representing a Stream with its offset.
|
| Constructor and Description |
|---|
XReadArgs() |
| Modifier and Type | Method and Description |
|---|---|
XReadArgs |
block(Duration timeout)
Perform a blocking read and wait up to a
timeout for a new stream message. |
XReadArgs |
block(long milliseconds)
Perform a blocking read and wait up to
milliseconds for a new stream message. |
<K,V> void |
build(CommandArgs<K,V> args)
Build command arguments and contribute arguments to
CommandArgs. |
XReadArgs |
count(long count)
Limit read to
count messages. |
XReadArgs |
noack(boolean noack)
Use NOACK option to disable auto-acknowledgement.
|
public XReadArgs block(long milliseconds)
milliseconds for a new stream message.milliseconds - max time to wait.this.public XReadArgs block(Duration timeout)
timeout for a new stream message.timeout - max time to wait.this.public XReadArgs count(long count)
count messages.count - number of messages.this.public XReadArgs noack(boolean noack)
noack - true to disable auto-ack.this.public <K,V> void build(CommandArgs<K,V> args)
CompositeArgumentCommandArgs.
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.
build in interface CompositeArgumentK - Key type.V - Value type.args - the command arguments, must not be null.Copyright © 2023 lettuce.io. All rights reserved.