Class: JobWorkflow::Runner
- Inherits:
-
Object
- Object
- JobWorkflow::Runner
- Defined in:
- lib/job_workflow/runner.rb
Overview
rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
: Context.
Instance Method Summary collapse
-
#initialize(context:) ⇒ Runner
constructor
: (context: Context) -> void.
-
#run ⇒ Object
: () -> void.
Constructor Details
#initialize(context:) ⇒ Runner
: (context: Context) -> void
8 9 10 11 |
# File 'lib/job_workflow/runner.rb', line 8 def initialize(context:) @context = context @job = context._job || (raise "current job is not set in context") end |
Instance Attribute Details
#context ⇒ Object (readonly)
: Context
5 6 7 |
# File 'lib/job_workflow/runner.rb', line 5 def context @context end |
Instance Method Details
#run ⇒ Object
: () -> void
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/job_workflow/runner.rb', line 14 def run task = context._task_context.task if !task.nil? && context.sub_job? run_task(task) persist_current_job_context return end catch(:rescheduled) { run_workflow } persist_current_job_context end |