Class: Operationable::Runners::Serial
- Defined in:
- lib/operationable/runners/serial.rb
Instance Attribute Summary
Attributes inherited from Base
#callbacks, #params, #record, #result, #user
Class Method Summary collapse
Instance Method Summary collapse
- #process ⇒ Object
-
#q_options ⇒ Object
TODO: No sense, due to performance deterioration, better use postgres/mysql database def self.call(q_options, props) instance = q_options.constantize.new(props).
- #run ⇒ Object
Methods inherited from Base
#check_status?, #ensure_enqueue, #initialize, #job_async_execute_method, #job_class, #job_method, #job_sync_execute_method, #persist?, #persist_operation
Constructor Details
This class inherits a constructor from Operationable::Runners::Base
Class Method Details
.call(q_options:, props:) ⇒ Object
16 17 18 19 |
# File 'lib/operationable/runners/serial.rb', line 16 def self.call(q_options:, props:) instance = [:callback_class_name].constantize.new(props) [:callback_names].each { |method_name| instance.method(method_name).call } end |
Instance Method Details
#process ⇒ Object
9 10 11 12 13 14 |
# File 'lib/operationable/runners/serial.rb', line 9 def process (queue.blank? ? self.class : job_method).call( q_options: , props: props ) end |
#q_options ⇒ Object
TODO: No sense, due to performance deterioration, better use postgres/mysql database def self.call(q_options, props)
instance = [:callback_class_name].constantize.new(props)
[:callback_names].each do |method_name|
::Operationable::Persister.around_call([:op_id], method_name, -> {
instance.method(method_name).call
})
end
end
32 33 34 35 36 37 38 |
# File 'lib/operationable/runners/serial.rb', line 32 def { type: 'serial', callback_class_name: callback_class_name, callback_names: callback_names, queue: queue, op_id: persist_operation.id } end |
#run ⇒ Object
5 6 7 |
# File 'lib/operationable/runners/serial.rb', line 5 def run process end |