You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/05/24 15:05:27 UTC

[GitHub] [incubator-kvrocks] torwig commented on pull request #594: Add optional parameter to LPOP/RPOP to pop more than 1 element

torwig commented on PR #594:
URL: https://github.com/apache/incubator-kvrocks/pull/594#issuecomment-1136049097

   @git-hulk I had a similar idea, but then I read the Redis docs:
   
   > When called without the count argument:
   > Bulk string reply: the value of the first element, or nil (**$-1**) when key does not exist.
   > When called with the count argument:
   > Array reply: list of popped elements, or nil (***-1**) when key does not exist.
   
   and I saw that BLPOP/BRPOP and RPopLPush use just `Pop` without `count` option, so I decided to leave `Pop` for popping a single element and introduce `PopMulti` for popping more than one element.
   Additionally, it's more explicit to return multiple elements from `PopMulti` inside a vector than to return just a single element inside a vector (if it's a special case for pop). 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org