Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QLPUSHTIMER command #7

Open
mc0 opened this issue Dec 7, 2014 · 1 comment
Open

QLPUSHTIMER command #7

mc0 opened this issue Dec 7, 2014 · 1 comment

Comments

@mc0
Copy link
Owner

mc0 commented Dec 7, 2014

The QLPUSHTIMER command would allow adding an event that should run after an elapsed number of seconds (waitDuration). This isn't a guaranteed contract except when the consumer sends the TIMER option to QRPOP command which will ensure all events have met their waitDuration before returning them.

Events in the same queue are expected to have the same waitDuration to maintain simple checks.

+QLPUSHTIMER queue eventID waitDuration contents
-QRPOP queue [EX seconds] [UNSAFE]
+QRPOP queue [EX seconds] [UNSAFE] [TIMER]
@mediocregopher
Copy link
Collaborator

I'm not totally sold on this feature, it seems like an odd thing to put in a queue. At the same time I understand why it'd be useful. I think we should try this out but be careful with how much complexity it's going to add to the codebase, I get the feeling it might not be worth it.

Also, if we do go forward with this, I think instead of TIMER we should instead make it WAIT. It's a little more clear what's actually going to happen. So the api would look like:

QLPUSHWAIT queue eventID waitDuration contents
QRPOP queue [EX seconds] [UNSAFE] [WAIT]

Maybe we should think about not even making a new push command? Maybe something like:

QLPUSH queue eventID contents [WAIT waitDuration]

Fewer commands is better, but more complex commands is worse, so I'm not sure of it. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants