Class: Conductor::Worker::TaskInProgress
- Inherits:
-
Object
- Object
- Conductor::Worker::TaskInProgress
- Defined in:
- lib/conductor/worker/task_in_progress.rb
Overview
Return type for long-running tasks When a worker returns TaskInProgress, the task remains in IN_PROGRESS state and Conductor will poll again after callback_after_seconds
Instance Attribute Summary collapse
-
#callback_after_seconds ⇒ Integer
Seconds to wait before Conductor polls again.
-
#output ⇒ Hash?
Intermediate output data.
Instance Method Summary collapse
-
#initialize(callback_after_seconds: 60, output: nil) ⇒ TaskInProgress
constructor
Create a TaskInProgress response.
-
#to_h ⇒ Hash
Convert to hash.
Constructor Details
#initialize(callback_after_seconds: 60, output: nil) ⇒ TaskInProgress
Create a TaskInProgress response
45 46 47 48 |
# File 'lib/conductor/worker/task_in_progress.rb', line 45 def initialize(callback_after_seconds: 60, output: nil) @callback_after_seconds = callback_after_seconds @output = output end |
Instance Attribute Details
#callback_after_seconds ⇒ Integer
Returns Seconds to wait before Conductor polls again.
37 38 39 |
# File 'lib/conductor/worker/task_in_progress.rb', line 37 def callback_after_seconds @callback_after_seconds end |
#output ⇒ Hash?
Returns Intermediate output data.
40 41 42 |
# File 'lib/conductor/worker/task_in_progress.rb', line 40 def output @output end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash
52 53 54 55 56 57 |
# File 'lib/conductor/worker/task_in_progress.rb', line 52 def to_h { callback_after_seconds: @callback_after_seconds, output: @output } end |