Module: Resque::Mixin::Async
- Defined in:
- lib/resque/mixin/async.rb
Overview
Module that provides easy queueing of jobs. Transparently handles instance and class methods.
If you consider this class:
class Repository < ActiveRecord::Base
include Resque::Mixin::Async
@queue = :high_priority
def self.create_index
# code
end
def notify_watchers
# code
end
end
you can queue new jobs on both the class and an instance like this:
@repository.async(:notify_watchers)
Repository.async(:create_index)
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
27 28 29 |
# File 'lib/resque/mixin/async.rb', line 27 def self.included(base) base.extend(ClassMethods) end |