Skip to content


Subversion checkout URL

You can clone with
Download ZIP


New command request: LPOPRPUSH, BLPOPRPUSH (for symmetry) #658

bluemont opened this Issue · 23 comments

Redis has:

It would be nice to have their "opposites" for symmetry:


This would allow an application to easily use these variants if they currently manage a list with RPUSH to push a message and BLPOP to fetch a message.






@antirez Any idea if that commit mentioned before is good for merging?


This commit exactly, very unlikely as it's against 2.4 branch and Redis implementation of blocking operations in Redis >= 2.6 is completely different :-) About the feature itself, I'm thinking about it for Redis 2.8, so I changed the milestone of this issue to 2.8 and check in a few weeks if I'll implement this. I can't reply right now as this is a design issue and I think to analyze the affair in depth before replying. Thanks!


Thank you @antirez! <3



We use RPOPLPUSH to implement the reliable queue pattern; move items from a "pending" queue into a "processing" queue. Unfortunately RPOPLPUSH only gets you half-way there. In the case the processing client goes down while processing an item that is now already in the "processing" queue, it has to move that item back to the head of the pending queue on restart. That's what LPOPRPUSH would do.


Sorry, moved again to 3.0... something we'll end having in the long run but probably needs some refactoring and not an absolute priority now that with Lua scripting you can at least implement LPOPRPUSH (without the blocking semantics of course).


@antirez Thanks for the update - sadly I'm not a C guy so I can't even contribute.. however more than happy to lend an extra pair of hands for testing etc when ready.


+1 for this feature.



@gresrun gresrun referenced this issue in gresrun/jesque

Reliable queues #43

@JackieXie168 JackieXie168 referenced this issue from a commit
@jdoliner jdoliner Fixes progress information to work for rdb protocol.
Welp that was stupid.
This doesn't address the time out issue but when I tested it it was
working fine for me. It atleast works some of the time.

Fixes #658.

I might be missing something, but I don't think commit c491db5 actually fixes this issue. (As in I don't see it adding the LPOPRPUSH command anywhere.)


I might be missing something,

Yeah, user JackieXie168 has polluted lots of Redis issues by doing something bad with GitHub (or GitHub did something bad with their repos). Somehow their issues are linked back to the main Redis issues even though they have nothing in common. It's pretty bad seeing fake "references" all the time, but we can't fix it from our side.

It's even quintuply bad because of the way GitHub makes the commit reference look like they are inside the Redis repo when they aren't actually there at all. Look at the tree for the bad commit referenced here: — It's an entirely different project!


Ugh, that sucks, but thanks for explaining what happened. Can this issue be reopened then?


Can this issue be reopened then?

This issue isn't closed! :)

The [CLOSED] above is referencing another irrelevant cross-repository issue leak: gresrun/jesque#43


... I'll shut up now. Thanks guys.




I did a very quick test just copying the rpoplpush command code and replacing REDIS_HEAD with REDIS_TAIL and vice-versa, and created a working lpoprpush command easily. I'll try to tidy up everything until tomorrow and create a pull-request (including a test case and documentation). Is there anything else I should be aware of? Some special condition or corner case?


Any news of this?


I created a pull request with these commands, but it still needs some work, I'm hoping to get some help here :)


@antirez Meybe some opinion from you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.