weyoss / redis-smq

A simple high-performance Redis message queue for Node.js.
MIT License
588 stars 64 forks source link

Feature request to delete published message using uuid #27

Closed gathm5 closed 5 years ago

gathm5 commented 5 years ago

Instead of shutting down the producer if there is an elegant way to call a function and stop the published message that will be nice. This could be useful if the publish is triggered by the user action from the client side and can be useful stopping the previous publish and generate new one.

weyoss commented 5 years ago

Instead of shutting down the producer if there is an elegant way to call a function and stop the published message that will be nice

Shutting down a producer is not intended to be used in order to cancel a message publication or to delete it. Instead it is used for releasing producer resources (disconnecting from Redis server and cleaning up).

Deleting/revoking an already published message is a resource-expensive operation with time complexity O(n). By design this message queue can not do what you want. I guess changing your approach can be sometimes helpful. If your really want that feature and you can not live without it, you can consider using an other more appropriate message queue.

gathm5 commented 5 years ago

Agreed. I think it will be easier to skip the message in the subscriber which would be more efficient in my case. Thanks for the library, it really provides simplicity and efficiency.