Class: Backgrounded::Resque::ResqueHandler
- Inherits:
-
Object
- Object
- Backgrounded::Resque::ResqueHandler
- Defined in:
- lib/backgrounded-resque/resque_handler.rb
Constant Summary collapse
- DEFAULT_QUEUE =
'backgrounded'
- INVALID_ID =
-1
Class Method Summary collapse
-
.perform(clazz, id, method, *args) ⇒ Object
invoke the requested method fired from the resque workers.
Instance Method Summary collapse
-
#request(object, method, args, options = {}) ⇒ Object
enqueue the requested operation into resque the resque worker will invoke .perform with the class/method/args.
Class Method Details
.perform(clazz, id, method, *args) ⇒ Object
invoke the requested method fired from the resque workers
27 28 29 |
# File 'lib/backgrounded-resque/resque_handler.rb', line 27 def self.perform(clazz, id, method, *args) find_instance(clazz, id, method).send(method, *args) end |
Instance Method Details
#request(object, method, args, options = {}) ⇒ Object
enqueue the requested operation into resque the resque worker will invoke .perform with the class/method/args
19 20 21 22 23 |
# File 'lib/backgrounded-resque/resque_handler.rb', line 19 def request(object, method, args, ={}) ResqueHandler.queue = [:queue] || DEFAULT_QUEUE instance, id = instance_identifiers(object) ::Resque.enqueue(ResqueHandler, instance, id, method, *args) end |