feat: LMPOP and ZMPOP commands - #317
Merged
Merged
Conversation
adds LMPOP and ZMPOP for atomic multi-key pop across lists and sorted sets. both commands scan keys left-to-right and pop from the first non-empty collection. LMPOP supports LEFT/RIGHT direction; ZMPOP supports MIN/MAX score order. optional COUNT argument (default 1) controls how many elements to pop. response format follows redis 7.0 spec: [key_name, [elements...]] or nil when all keys are empty. persistence: LMPOP is replayed as individual LPOP/RPOP records; ZMPOP is replayed as ZREM of the popped members.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
LMPOP numkeys key [key ...] LEFT|RIGHT [COUNT n]for atomic multi-key list popZMPOP numkeys key [key ...] MIN|MAX [COUNT n]for atomic multi-key sorted set pop[key_name, [elements]]or nil when all keys emptytested
lpop_count/rpop_countin keyspace (count, capped-at-size, missing key, wrong type)design notes
execute.rs drives the key-scan loop: for each key, it sends a
LmpopSingle/ZmpopSinglesub-request to the owning shard and returns immediately on the first non-empty result. this keeps all the routing logic in execute.rs and the shard dispatch simple.