Open coderberry opened 6 years ago
Does this need to be implemented within Rihanna itself? It would be easy for a job to rate limit itself using something like Hammer (https://github.com/ExHammer/hammer) and re-enqueuing itself later if it has been limited.
I would be concerned about the performance implications of implementing this in core Rihanna for regular non-limited users.
@lpil to be fair, hammer requires either Redis or mnesia (urgh). Many people who use Rihanna do so explicitly because they don't want to bring on another third party service.
It has a pluggable backend so you could use Postgres or whatever else if you want.
One of the hardest things to manage when dealing with background jobs is rate limiting requests.
Here's the free OSS solution I use currently in ruby: https://github.com/enova/sidekiq-rate-limiter
Here is the page that describes the problem and solution (with Sidekiq enterprise):
https://github.com/mperham/sidekiq/wiki/Ent-Rate-Limiting
Thank you for your contributions to OSS!!!