Package io.lettuce.core
Class XAutoClaimArgs<K>
- java.lang.Object
-
- io.lettuce.core.XAutoClaimArgs<K>
-
- All Implemented Interfaces:
CompositeArgument
public class XAutoClaimArgs<K> extends Object implements CompositeArgument
Argument list builder for the Redis XAUTOCLAIM command. Static import the methods fromXAutoClaimArgs.Builder
and call the methods:xautoclaim(…)
.XAutoClaimArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 6.1
- Author:
- dengliming
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XAutoClaimArgs.Builder
Builder entry points forXAutoClaimArgs
.
-
Constructor Summary
Constructors Constructor Description XAutoClaimArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.XAutoClaimArgs<K>
consumer(Consumer<K> consumer)
Configure theConsumer
.XAutoClaimArgs<K>
count(long count)
The optionalcount
argument, which defaults to100
, is the upper limit of the number of entries that the command attempts to claim.boolean
isJustid()
XAutoClaimArgs<K>
justid()
The optionalJUSTID
argument changes the reply to return just an array of IDs of messages successfully claimed, without returning the actual message.XAutoClaimArgs<K>
minIdleTime(long milliseconds)
Return only messages that are idle for at leastmilliseconds
.XAutoClaimArgs<K>
minIdleTime(Duration minIdleTime)
Return only messages that are idle for at leastminIdleTime
.XAutoClaimArgs<K>
startId(String startId)
Set the startId.
-
-
-
Method Detail
-
consumer
public XAutoClaimArgs<K> consumer(Consumer<K> consumer)
Configure theConsumer
.- Parameters:
consumer
-- Returns:
this
.
-
count
public XAutoClaimArgs<K> count(long count)
The optionalcount
argument, which defaults to100
, is the upper limit of the number of entries that the command attempts to claim.- Parameters:
count
-- Returns:
this
.
-
justid
public XAutoClaimArgs<K> justid()
The optionalJUSTID
argument changes the reply to return just an array of IDs of messages successfully claimed, without returning the actual message. Using this option means the retry counter is not incremented.- Returns:
this
.
-
minIdleTime
public XAutoClaimArgs<K> minIdleTime(long milliseconds)
Return only messages that are idle for at leastmilliseconds
.- Parameters:
milliseconds
- min idle time.- Returns:
this
.
-
minIdleTime
public XAutoClaimArgs<K> minIdleTime(Duration minIdleTime)
Return only messages that are idle for at leastminIdleTime
.- Parameters:
minIdleTime
- min idle time.- Returns:
this
.
-
startId
public XAutoClaimArgs<K> startId(String startId)
Set the startId.- Parameters:
startId
-- Returns:
-
isJustid
public boolean isJustid()
-
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
.
-
-