Resque Throttler allows you to throttle the rate at which jobs are performed on a specific queue.
If the queue is above the rate limit then the workers will ignore the queue until the queue is below the rate limit.
Installation
require 'resque/throttler'
Or in a Gemfile:
gem 'resque-throttler', :require => 'resque/throttler'
Usage
require 'resque'
require 'resque/throttler'
# Rate limit at 10 jobs from `my_queue` per minute
Resque.rate_limit(:my_queue, :at => 10, :per => 60)
Similar Resque Plugins
-
Only allows one job to be performed at once from a
queue
. With Resque Throttler you can achieve the same functionarliy with the following rate limit:Resque.rate_limit(:my_queue, :at => 1, :per => 0)
-
Works on a
class
rather than aqueue
and will throw and error when you try to enqueue at job when theclass
is at or above it's rate limit. -
Looks like it also works on a
class
and throws the jobs into a"waiting_room"
queue that then gets processed.