Module: Backburner::Performable::ClassMethods
- Defined in:
- lib/backburner/performable.rb
Overview
InstanceMethods
Instance Method Summary collapse
-
#async(opts = {}) ⇒ Object
Return proxy object to enqueue jobs for object Options:
pri(priority),delay(delay in secs),ttr(time to respond),queue(queue name). -
#handle_asynchronously(method, opts = {}) ⇒ Object
Always handle an instance method asynchronously.
-
#handle_static_asynchronously(method, opts = {}) ⇒ Object
Always handle a class method asynchronously.
-
#perform(id, method, *args) ⇒ Object
Defines perform method for job processing.
Instance Method Details
#async(opts = {}) ⇒ Object
Return proxy object to enqueue jobs for object
Options: pri (priority), delay (delay in secs), ttr (time to respond), queue (queue name)
27 28 29 |
# File 'lib/backburner/performable.rb', line 27 def async(opts={}) Backburner::AsyncProxy.new(self, nil, opts) end |
#handle_asynchronously(method, opts = {}) ⇒ Object
Always handle an instance method asynchronously
45 46 47 |
# File 'lib/backburner/performable.rb', line 45 def handle_asynchronously(method, opts={}) Backburner::Performable.handle_asynchronously(self, method, opts) end |
#handle_static_asynchronously(method, opts = {}) ⇒ Object
Always handle a class method asynchronously
52 53 54 |
# File 'lib/backburner/performable.rb', line 52 def handle_static_asynchronously(method, opts={}) Backburner::Performable.handle_static_asynchronously(self, method, opts) end |
#perform(id, method, *args) ⇒ Object
Defines perform method for job processing
34 35 36 37 38 39 40 |
# File 'lib/backburner/performable.rb', line 34 def perform(id, method, *args) if id # instance find(id).send(method, *args) else # class method send(method, *args) end end |