summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2021-09-09 17:02:33 +0800
committerGitHub <noreply@github.com>2021-09-09 12:02:33 +0300
commitc50af0aeba693bf93e5c471cff08d8ccde0f5213 (patch)
tree5140419b0af05e02c0d88a737d8349d4d2eafdf9 /deps
parent216f168b2b144ecf3d082fa9df20970901479d32 (diff)
downloadredis-c50af0aeba693bf93e5c471cff08d8ccde0f5213.tar.gz
Add LMPOP/BLMPOP commands. (#9373)
We want to add COUNT option for BLPOP. But we can't do it without breaking compatibility due to the command arguments syntax. So this commit introduce two new commands. Syntax for the new LMPOP command: `LMPOP numkeys [<key> ...] LEFT|RIGHT [COUNT count]` Syntax for the new BLMPOP command: `BLMPOP timeout numkeys [<key> ...] LEFT|RIGHT [COUNT count]` Some background: - LPOP takes one key, and can return multiple elements. - BLPOP takes multiple keys, but returns one element from just one key. - LMPOP can take multiple keys and return multiple elements from just one key. Note that LMPOP/BLMPOP can take multiple keys, it eventually operates on just one key. And it will propagate as LPOP or RPOP with the COUNT option. As a new command, it still return NIL if we can't pop any elements. For the normal response is nested arrays in RESP2 and RESP3, like: ``` LMPOP/BLMPOP 1) keyname 2) 1) element1 2) element2 ``` I.e. unlike BLPOP that returns a key name and one element so it uses a flat array, and LPOP that returns multiple elements with no key name, and again uses a flat array, this one has to return a nested array, and it does for for both RESP2 and RESP3 (like SCAN does) Some discuss can see: #766 #8824
Diffstat (limited to 'deps')
0 files changed, 0 insertions, 0 deletions