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
Delete message on receive #22
Comments
This is a good enhancement. I will implement it hopefully this week. |
I added a 'popMessage' method. Docs: https://github.com/smrchy/rsmq#popmessage Hope this does what you need. |
Marvellous. I'll test this out right away. Thanks for the speedy implementation! |
Please close this issue if it works for you. |
Works great, thanks! |
Is it a good approach to set a TTL to each message? |
If you need a TTL (only valid till A TTL feature for RSMQ is not planned as this would make regular housekeeping necessary which is something i'd like to avoid. |
Thanks for a great queue library!
For my application, I'm looking to delete a message as it is received. I can currently do this by issuing a
deleteMessage
straight after areceiveMessage
, but I'd like to go one step further and add support for this in thereceiveMessage
lua script, so that the delete happens atomically.I was wondering whether you'd accept a PR which implements this functionality.
Here's what I'm thinking:
vt
of-1
- this indicates that a message should be deleted when it is pulled off the queue.vt
is-1
in the lua script - if so, run thezrem
andhdel
operations to delete the message.If reusing the
vt
variable isn't desirable, perhaps a new option could be used instead, for exampleremove_on_receive
.The text was updated successfully, but these errors were encountered: