Repository navigation
[Redis 8.10] Add LMOVEM and BLMOVEM list commands - #3858
Conversation
| * @param args command arguments to configure source and destination directions and the optional count block. | ||
| * @param timeout the timeout in seconds. | ||
| * @return List<V> array-reply the elements being popped and pushed, or an empty list when the timeout was reached. | ||
| * @since 7.8 |
There was a problem hiding this comment.
Current release is 7.6.
Are we planning another release before releasing the 8.10 command support?
|
|
||
| CommandArgs<K, V> args = new CommandArgs<>(codec); | ||
| args.addKey(source).addKey(destination); | ||
| lMovemArgs.buildDirections(args); |
There was a problem hiding this comment.
This is a bit strange.
with current approach we need to keep in mind if we add more options to LMovemArgs, they will not propagate automatically for the BLMOVEM command. command.
On the other hand, to resolve it, I see a few options, but each of them will require blmovem API to differ from the blmove API
A. Separate blocking args class.
lmovem(K src, K dst, LMoveArgs directions, LMovemCountArgs count)
blmovem(K src, K dst, LMoveArgs directions, double timeout, LMovemCountArgs count)
B. Move the timeout into the args object
BLMovemArgs.Builder.leftRight().count(2, BULK).timeout(1.5) // blocking variant
blmovem(K source, K destination, BLMovemArgs args) // no timeout param
| * @return List<V> array-reply the elements being popped and pushed, or an empty list when the timeout was reached. | ||
| * @since 7.8 | ||
| */ | ||
| List<V> blmovem(K source, K destination, LMovemArgs args, double timeout); |
There was a problem hiding this comment.
i vote for a BLMovemArgs inheriting LMovemArgs
| * @return List<V> array-reply the elements being popped and pushed, or an empty list when the timeout was reached. | ||
| * @since 7.8 | ||
| */ | ||
| RedisFuture<List<V>> blmovem(K source, K destination, LMovemArgs args, double timeout); |
There was a problem hiding this comment.
what about if command timesout is less than explicit timeout parameter. We should at least the explain the possible consequences if it is not something to solve in this PR.
BTW SE.Redis decided to not implement for blocking version due to the multiplexing nature of the core.
There was a problem hiding this comment.
sorry, not the version but the blocking variant of the command.
There was a problem hiding this comment.
Lettuce has already established the precedent that it supports blocking commands
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 292c353. Configure here.

Adds client support for the new
LMOVEMandBLMOVEMcommands (Redis 8.10), the multi-element counterparts ofLMOVE/BLMOVE. Both move one or more elements between the head/tail of a source and destination list, with an optionalCOUNT/EXACTLYcount andOBO/BULKordering. The commands are exposed across the sync, async, reactive, and Kotlin coroutine APIs.Key Decisions & Assumptions
LMovemArgsrather than extendingLMoveArgs, since the count block is meaningless forLMOVE/BLMOVE. When a count is set without an explicit ordering, it defaults toBULK.BLMOVEMplacestimeoutbetween the directions and the optional count block (per the command grammar), unlikeBLMOVEwhere it trails;LMovemArgssplits direction/count building to support this.List<V>(Flux<V>reactive), matchinglpop(key, count). A nil reply —EXACTLYunsatisfiable, or aBLMOVEMtimeout — surfaces as an empty list (emptyFluxreactively), consistent with existing list commands rather thannull.@since 7.8.Behavioral / Conceptual Changes
CommandTypeentriesLMOVEM/BLMOVEMandCommandKeywordtokensEXACTLY/OBO/BULK.lmovem/blmovembehave likelmove/blmovebut return a single-element list.Testing
Adds command-builder unit tests asserting the encoded argument order (including the
BLMOVEMtimeout placement and theBULKdefault). Adds integration tests covering plain moves,COUNT/EXACTLYwithOBOandBULKordering, and the unsatisfied-EXACTLYempty result; these run under sync, reactive, and a new RESP2 overload, and are gated with@EnabledOnCommand.Note
Low Risk
Additive API and protocol support for new Redis commands; no changes to existing LMOVE/BLMOVE behavior beyond new methods and types.
Overview
Adds client support for Redis 8.10 LMOVEM and BLMOVEM, which atomically move one or more elements between lists (multi-element variants of
LMOVE/BLMOVE).New
LMovemArgsandBLMovemArgsbuilders configure head/tail directions plus optionalCOUNT/EXACTLYwithOBOorBULKordering.BLMovemArgsis separate fromLMovemArgsso blocking timeouts cannot be sent on the non-blocking command; forBLMOVEM, the timeout is encoded between directions and the count block (unlikeBLMOVE, where timeout trails). Protocol addsLMOVEM/BLMOVEMand keywordsEXACTLY,OBO,BULK.lmovem/blmovemare wired throughRedisCommandBuilderwithValueListOutput, exposed on sync, async, reactive (Flux<V>), Kotlin coroutines, and cluster node-selection APIs. Results areList<V>; nil/timeout/unsatisfiedEXACTLYmap to an empty list (emptyFluxreactively), aligned with other multi-pop list commands. Without a count block, behavior matches single-elementlmove/blmovebut returns a one-element list.Unit tests assert encoded argument order; integration tests cover moves, count ordering,
EXACTLYfailure, andBLMOVEMtimeouts, gated with@EnabledOnCommandand duplicated under RESP2.Reviewed by Cursor Bugbot for commit 0a2c145. Bugbot is set up for automated code reviews on this repo. Configure here.