Class: Shoryuken::Worker::InlineExecutor
- Inherits:
-
Object
- Object
- Shoryuken::Worker::InlineExecutor
- Defined in:
- lib/shoryuken/worker/inline_executor.rb
Class Method Summary collapse
- .perform_async(worker_class, body, options = {}) ⇒ Object
- .perform_in(worker_class, _interval, body, options = {}) ⇒ Object
Class Method Details
.perform_async(worker_class, body, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/shoryuken/worker/inline_executor.rb', line 5 def perform_async(worker_class, body, = {}) body = JSON.dump(body) if body.is_a?(Hash) queue_name = .delete(:queue) || worker_class.['queue'] sqs_msg = OpenStruct.new( body: body, attributes: nil, md5_of_body: nil, md5_of_message_attributes: nil, message_attributes: nil, message_id: nil, receipt_handle: nil, delete: nil, queue_name: queue_name ) call(worker_class, sqs_msg) end |
.perform_in(worker_class, _interval, body, options = {}) ⇒ Object
24 25 26 |
# File 'lib/shoryuken/worker/inline_executor.rb', line 24 def perform_in(worker_class, _interval, body, = {}) worker_class.perform_async(body, ) end |