Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Resque plugin that understands individual jobs can belong to something bigger than themselves
Ruby
branch: master

This branch is 3 commits ahead, 97 commits behind drfeelngood:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
lib
test
LICENSE
README.markdown
Rakefile
resque-batched-job.gemspec

README.markdown

Resque Batched Job

A Resque plugin. Requires Resque 1.10.0

This plugin adds the ability to batch jobs and run additional hooks after the last job in a batch is performed. Using the 'after_enqueue' hook, the jobs arguments are stored in a Redis set identified by the batch id provided. By default, the batch keys look like 'batch:'. After each job is performed, its arguments are removed from the set. If the last job performed happens to be the last in a set, additional hooks are executed. These hooks are prefixed with 'after_batch'.

Installation

gem install resque-batched-job

Example

module Job
  extend Resque::Plugins::BatchedJob

  def self.perform(id, *args)
    prime(id, args)
  end

  def self.after_batch_heavy_lifting(id, *args)
    heavy_lifting(id)
  end

end
Something went wrong with that request. Please try again.