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)
25 26 27 |
# File 'lib/backburner/performable.rb', line 25 def async(opts={}) Backburner::AsyncProxy.new(self, nil, opts) end |
#handle_asynchronously(method, opts = {}) ⇒ Object
Always handle an instance method asynchronously
43 44 45 |
# File 'lib/backburner/performable.rb', line 43 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
50 51 52 |
# File 'lib/backburner/performable.rb', line 50 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
32 33 34 35 36 37 38 |
# File 'lib/backburner/performable.rb', line 32 def perform(id, method, *args) if id # instance find(id).send(method, *args) else # class method send(method, *args) end end |