taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 130 forks source link

[#244] MQ: Add initial-backoff option to enqueue #245

Closed st3fan closed 3 years ago

st3fan commented 3 years ago

Draft Pull Request because it is work in progress.

For #244 - This patch adds an :initial-backoff-ms option to enqueue. I implemented this by allowing an initial value to be set in the qk-backoffs hash on message creation. This seems to do the trick.

Also included a new test to validate the :initial-backoff-ms behaviour. I think it would be interesting to do a bit of a stress test with this feature - are longer running tests allowed/wanted?

ptaoussanis commented 3 years ago

@st3fan Hi Stefan, definitely open for a PR- and this is looking good, thanks!

I think it would be interesting to do a bit of a stress test with this feature - are longer running tests allowed/wanted?

Allowed + wanted 👍

st3fan commented 3 years ago

Thank you for tips - I'll work on some improvements and better tests. I also left a question at https://github.com/ptaoussanis/carmine/pull/245/files#diff-9f2681c4ea1ec7b7c79bb31ad60f7b4847786cd2b4f3df935e8eb8c58869d364R176 but now I am actually wondering if the behaviour under that comment is correct .. if there are two messages available, should dequeue actually return eoq-backoff ?

ptaoussanis commented 3 years ago

https://github.com/ptaoussanis/carmine/releases/tag/v3.1.0 is now on Clojars 👍
Thanks again.

Cheers!