enova / sidekiq-rate-limiter

Redis-backed, per-worker rate limits for job processing.
http://rubygems.org/gems/sidekiq-rate-limiter
MIT License
192 stars 43 forks source link

Per server rate limit #6

Closed bwthomas closed 10 years ago

bwthomas commented 10 years ago

Rebased on from master. See #5.

sentience commented 10 years ago

Thanks for the comments, @bwthomas! I agree with your sentiments and will respond with some changes shortly.

sentience commented 10 years ago

Now that I’ve implemented in #7 support for using Procs to calculate option values dynamically, I’m wondering if this feature is an unnecessary specialisation of the more general ability to set 'name' dynamically per host.

E.g. I could now impose a per-server-hostname limit as follows:

  sidekiq_options 'queue' => 'my_queue',
                  'rate' => {
                    'limit' => 10,
                    'period' => 10,
                    'name' => ->{ Socket.gethostname } ,
                  }

What do you think? Abandon this feature and focus on #7?

bwthomas commented 10 years ago

I agree, I like the more general approach. I'm going to close this out, & let's focus on using callables.