Skip to content
Resque plugin that understands individual jobs can belong to something bigger than themselves
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example updated perfom_perfom method name Oct 20, 2010
lib v1.9.0 Jun 22, 2015
test Add test for job that mutates the arg Jun 19, 2015
.gitignore Updated travis-ci configuration. Jan 19, 2015
.travis.yml Updated travis-ci configuration. Jan 19, 2015
Gemfile Specify turn & minitest versions, turn is not compatible with minites… Nov 20, 2013
LICENSE Use MIT because I really don't care Jul 11, 2013
README.md
Rakefile
resque-batched-job.gemspec Deprecated inclusion of Resque::Helpers. Feb 14, 2015

README.md

Resque Batched Job Build Status

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 job is encoded and stored in a Redis List identified by the batch id provided. By default, the batch keys look like 'batch:#{id}'. After each job is performed, it's removed from the batch list. If the last job performed happens to be the last in the list, additional hooks are executed. These hooks are prefixed with 'after_batch'.

Installation

$ gem install resque-batched-job

Example

require 'resque/batched_job'

module Job
  extend Resque::Plugins::BatchedJob

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

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

end
You can’t perform that action at this time.