Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (25 sloc) 1.26 KB


Resque Concurrent Restriction is a plugin for the Resque queueing system ( It allows one to specify how many of the given job can run concurrently.

Resque Concurrent Restriction requires Resque 1.10 and redis 2.2


sudo gem install resque-concurrent-restriction

To use

It is especially useful when a system has intensive jobs for which you should only run a few at a time. What you should do for the IntensiveJob is to make it extend Resque::Plugins::ConcurrentRestriction and specify the concurrent limit (defaults to 1). For example:

class IntensiveJob
  extend Resque::Plugins::ConcurrentRestriction
  concurrent 4

  #rest of your class here

That means the IntensiveJob can not have more than 4 jobs running simultaneously


Code was originally forkd from the resque-restriction plugin (Richard Huang :: :: @flyerhzm), but diverged enough that it warranted being its own plugin to keep the code simple.

Matt Conway :: :: @mattconway


Copyright (c) 2011 Matt Conway. See LICENSE for details.