Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
bluemont opened this Issue · 23 comments
@bluemont

Redis has:

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

  • LPOPRPUSH
  • BLPOPRPUSH

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.

@foxx

+1

@drasill

+1

@foxx

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

@antirez
Owner

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!

@foxx

Thank you @antirez! <3

@jschwertfeger

:+1:

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.

@antirez
Owner

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).

@foxx

@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.

@jhoblitt

+1 for this feature.

@gresrun

+1

@gresrun gresrun referenced this issue in gresrun/jesque
Closed

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.
c491db5
@mmueller

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.)

@mattsta

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: https://github.com/antirez/redis/tree/c491db5597aa0ec3cd2b8f20c6b444f7248f7b48 — It's an entirely different project!

@mmueller

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

@mattsta

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

@mmueller

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

@mgsloan

+1

@felipou

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?

@dopesong

Any news of this?

@felipou

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

@dopesong

@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.