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 |
claim(Duration timeout)
Claim idle pending messages first with a minimum idle time (milliseconds).
|
XReadArgs |
claim(long milliseconds)
Claim idle pending messages first with a minimum idle time (milliseconds).
|
XReadArgs |
count(long count)
Limit read to
count messages. |
XReadArgs |
maxCount(long maxCount)
Limit the cumulative number of returned entries across all streams to
maxCount. |
XReadArgs |
maxSize(long maxSize)
Apply a soft cap of
maxSize bytes to the cumulative reply size across all streams. |
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 maxCount(long maxCount)
maxCount. Unlike COUNT, which is
a per-stream limit, MAXCOUNT caps the whole command reply. Once the cap is reached, remaining streams are
skipped. Defaults to unlimited when not set. When used together with COUNT, maxCount must be greater
than or equal to the count.maxCount - cumulative cap on the number of returned entries across all streams, must be positive.this.public XReadArgs maxSize(long maxSize)
maxSize bytes to the cumulative reply size across all streams. The server measures the
serialized reply including protocol overhead, so this is not an exact payload-size guarantee: the first available entry
is returned even when it alone exceeds the cap, and emission stops before the next entry once the budget is reached. Once
the cap is reached, remaining streams are skipped. Defaults to unlimited when not set.maxSize - soft cumulative cap on the reply size in bytes across all streams, must be positive.this.public XReadArgs noack(boolean noack)
noack - true to disable auto-ack.this.public XReadArgs claim(long milliseconds)
milliseconds - minimum idle time.this.public XReadArgs claim(Duration timeout)
timeout - minimum idle time.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 © 2026 lettuce.io. All rights reserved.