Class: Hatchet::TriggerWorkflowOptions
- Inherits:
-
Object
- Object
- Hatchet::TriggerWorkflowOptions
- Defined in:
- lib/hatchet/trigger_options.rb
Overview
Options for triggering a workflow run
Direct Known Subclasses
Instance Attribute Summary collapse
-
#additional_metadata ⇒ Hash?
readonly
Additional metadata to attach to the run.
-
#child_index ⇒ Integer?
readonly
Child index for deterministic replay.
-
#desired_worker_labels ⇒ Hash?
readonly
Desired worker labels for scheduling.
-
#key ⇒ String?
readonly
Deduplication key.
-
#parent_id ⇒ String?
readonly
Parent workflow run ID (auto-set from context vars).
-
#parent_step_run_id ⇒ String?
readonly
Parent step run ID (auto-set from context vars).
-
#priority ⇒ Integer?
readonly
Priority level (1-4, higher = more priority).
-
#sticky ⇒ Boolean?
readonly
Whether to use sticky scheduling.
Instance Method Summary collapse
-
#initialize(additional_metadata: nil, key: nil, priority: nil, parent_id: nil, parent_step_run_id: nil, child_index: nil, sticky: nil, desired_worker_labels: nil) ⇒ TriggerWorkflowOptions
constructor
A new instance of TriggerWorkflowOptions.
- #to_h ⇒ Hash
Constructor Details
#initialize(additional_metadata: nil, key: nil, priority: nil, parent_id: nil, parent_step_run_id: nil, child_index: nil, sticky: nil, desired_worker_labels: nil) ⇒ TriggerWorkflowOptions
Returns a new instance of TriggerWorkflowOptions.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/hatchet/trigger_options.rb', line 44 def initialize( additional_metadata: nil, key: nil, priority: nil, parent_id: nil, parent_step_run_id: nil, child_index: nil, sticky: nil, desired_worker_labels: nil ) @additional_metadata = @key = key @priority = priority @parent_id = parent_id @parent_step_run_id = parent_step_run_id @child_index = child_index @sticky = sticky @desired_worker_labels = desired_worker_labels end |
Instance Attribute Details
#additional_metadata ⇒ Hash? (readonly)
Returns Additional metadata to attach to the run.
13 14 15 |
# File 'lib/hatchet/trigger_options.rb', line 13 def @additional_metadata end |
#child_index ⇒ Integer? (readonly)
Returns Child index for deterministic replay.
28 29 30 |
# File 'lib/hatchet/trigger_options.rb', line 28 def child_index @child_index end |
#desired_worker_labels ⇒ Hash? (readonly)
Returns Desired worker labels for scheduling.
34 35 36 |
# File 'lib/hatchet/trigger_options.rb', line 34 def desired_worker_labels @desired_worker_labels end |
#key ⇒ String? (readonly)
Returns Deduplication key.
16 17 18 |
# File 'lib/hatchet/trigger_options.rb', line 16 def key @key end |
#parent_id ⇒ String? (readonly)
Returns Parent workflow run ID (auto-set from context vars).
22 23 24 |
# File 'lib/hatchet/trigger_options.rb', line 22 def parent_id @parent_id end |
#parent_step_run_id ⇒ String? (readonly)
Returns Parent step run ID (auto-set from context vars).
25 26 27 |
# File 'lib/hatchet/trigger_options.rb', line 25 def parent_step_run_id @parent_step_run_id end |
#priority ⇒ Integer? (readonly)
Returns Priority level (1-4, higher = more priority).
19 20 21 |
# File 'lib/hatchet/trigger_options.rb', line 19 def priority @priority end |
#sticky ⇒ Boolean? (readonly)
Returns Whether to use sticky scheduling.
31 32 33 |
# File 'lib/hatchet/trigger_options.rb', line 31 def sticky @sticky end |
Instance Method Details
#to_h ⇒ Hash
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/hatchet/trigger_options.rb', line 65 def to_h h = {} h[:additional_metadata] = @additional_metadata if @additional_metadata h[:key] = @key if @key h[:priority] = @priority if @priority h[:parent_id] = @parent_id if @parent_id h[:parent_step_run_id] = @parent_step_run_id if @parent_step_run_id h[:child_index] = @child_index if @child_index h[:sticky] = @sticky unless @sticky.nil? h[:desired_worker_labels] = @desired_worker_labels if @desired_worker_labels h end |