No commit activity in last 3 years
No release in over 3 years
Provides Resque with functionality to asynchronously process any method. This can help clean up the default Resque code that is requred to process your methods.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

Adds methods to background any method in Resque. This is useful for removing the large amounts of Resque code normally required if backgrounding multiple methods in a single model.

Methods

  • Class.resque(method, *args) backgrounds a class method call.
  • resque(method, *args) backgrounds an instance method call.
  • resque_queue(queue) chooses which queue to add the backgrounded methods to.

Examples

class Post < ActiveRecord::Base
  include ResqueAnyMethod
  resque_queue :archive

  self << class
    def archive_old_posts(num_to_keep)
      # logic
    end
  end

  def archive
    # logic
  end
end

> Post.resque(:archive_old_posts, 5)
# Backgrounds `Post.archive_old_posts(5)` for Resque.

> post.resque(:archive)
# Backgrounds `Post.find(post_id).archive` for Resque.