Class: Dynflow::ActiveJob::QueueAdapters::JobWrapper

Inherits:
Dynflow::Action show all
Defined in:
lib/dynflow/active_job/queue_adapter.rb

Constant Summary

Constants inherited from Dynflow::Action

Dynflow::Action::DelayedEvent, Dynflow::Action::ERROR, Dynflow::Action::OutputReference, Dynflow::Action::SUSPEND, Dynflow::Action::Skip

Constants included from Dynflow::Action::Rescue

Dynflow::Action::Rescue::Strategy, Dynflow::Action::Rescue::SuggestedStrategy

Constants inherited from Serializable

Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT

Instance Attribute Summary

Attributes inherited from Dynflow::Action

#caller_action_id, #caller_execution_plan_id, #execution_plan_id, #finalize_step_id, #id, #input, #pending_output_chunks, #phase, #plan_step_id, #run_step_id, #world

Attributes included from Dynflow::Action::Progress

#calculated_progress

Instance Method Summary collapse

Methods inherited from Dynflow::Action

#action_logger, all_children, #all_planned_actions, #caller_action, children, constantize, #delayed_events, #drop_output_chunks!, #error, #execute, #execute_delay, #execution_plan, execution_plan_hooks, #finalize_step, #from_subscription?, #holds_singleton_lock?, #humanized_state, inherit_execution_plan_hooks, inherited, #initialize, middleware, #output, #output=, #output_chunk, #phase!, #phase?, #plan_event, #plan_step, #planned_actions, #required_step_ids, #run_step, #serializer, #set_plan_context, #state, #steps, #stored_output_chunks, subscribe, #to_hash, #triggering_action

Methods included from Dynflow::Action::Format

#input_format, #output_format

Methods included from Dynflow::Action::Rescue

#combine_suggested_strategies, #rescue_strategy_for_planned_action, #rescue_strategy_for_self

Methods included from Dynflow::Action::Progress

#finalize_progress, #finalize_progress_weight, #run_progress, #run_progress_weight

Methods inherited from Serializable

constantize, from_hash, new_from_hash, #to_hash

Constructor Details

This class inherits a constructor from Dynflow::Action

Instance Method Details

#labelObject



51
52
53
# File 'lib/dynflow/active_job/queue_adapter.rb', line 51

def label
  input[:job_class]
end

#plan(attributes) ⇒ Object



40
41
42
43
44
45
# File 'lib/dynflow/active_job/queue_adapter.rb', line 40

def plan(attributes)
  input[:job_class] = attributes['job_class']
  input[:queue] = attributes['queue_name']
  input[:job_data] = attributes
  plan_self
end

#queueObject



36
37
38
# File 'lib/dynflow/active_job/queue_adapter.rb', line 36

def queue
  input[:queue].to_sym
end

#rescue_strategyObject



55
56
57
# File 'lib/dynflow/active_job/queue_adapter.rb', line 55

def rescue_strategy
  Action::Rescue::Skip
end

#runObject



47
48
49
# File 'lib/dynflow/active_job/queue_adapter.rb', line 47

def run
  ::ActiveJob::Base.execute(input[:job_data])
end