Giter Site home page Giter Site logo

josh-m-sharpe / resque-batched-job Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drfeelngood/resque-batched-job

0.0 0.0 0.0 257 KB

Resque plugin that understands individual jobs can belong to something bigger than themselves

Home Page: https://rubygems.org/gems/resque-batched-job

License: MIT License

Ruby 100.00%

resque-batched-job's Introduction

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

resque-batched-job's People

Contributors

drfeelngood avatar dfockler avatar jakemack avatar nfo avatar jpl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.