Class: Dynflow::Director::WorkItem
- Inherits:
-
Serializable
- Object
- Serializable
- Dynflow::Director::WorkItem
- Defined in:
- lib/dynflow/director.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Serializable
Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT
Instance Attribute Summary collapse
-
#execution_plan_id ⇒ Object
readonly
Returns the value of attribute execution_plan_id.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#sender_orchestrator_id ⇒ Object
readonly
Returns the value of attribute sender_orchestrator_id.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(execution_plan_id, queue, sender_orchestrator_id) ⇒ WorkItem
constructor
A new instance of WorkItem.
- #to_hash ⇒ Object
- #world ⇒ Object
-
#world=(world) ⇒ Object
the world to be used for execution purposes of the step.
Methods inherited from Serializable
Constructor Details
#initialize(execution_plan_id, queue, sender_orchestrator_id) ⇒ WorkItem
Returns a new instance of WorkItem.
27 28 29 30 31 |
# File 'lib/dynflow/director.rb', line 27 def initialize(execution_plan_id, queue, sender_orchestrator_id) @execution_plan_id = execution_plan_id @queue = queue @sender_orchestrator_id = sender_orchestrator_id end |
Instance Attribute Details
#execution_plan_id ⇒ Object (readonly)
Returns the value of attribute execution_plan_id.
25 26 27 |
# File 'lib/dynflow/director.rb', line 25 def execution_plan_id @execution_plan_id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
25 26 27 |
# File 'lib/dynflow/director.rb', line 25 def queue @queue end |
#sender_orchestrator_id ⇒ Object (readonly)
Returns the value of attribute sender_orchestrator_id.
25 26 27 |
# File 'lib/dynflow/director.rb', line 25 def sender_orchestrator_id @sender_orchestrator_id end |
Class Method Details
.new_from_hash(hash, *_args) ⇒ Object
55 56 57 |
# File 'lib/dynflow/director.rb', line 55 def self.new_from_hash(hash, *_args) self.new(hash[:execution_plan_id], hash[:queue], hash[:sender_orchestrator_id]) end |
Instance Method Details
#execute ⇒ Object
44 45 46 |
# File 'lib/dynflow/director.rb', line 44 def execute raise NotImplementedError end |
#to_hash ⇒ Object
48 49 50 51 52 53 |
# File 'lib/dynflow/director.rb', line 48 def to_hash { class: self.class.name, execution_plan_id: execution_plan_id, queue: queue, sender_orchestrator_id: sender_orchestrator_id } end |
#world ⇒ Object
33 34 35 36 |
# File 'lib/dynflow/director.rb', line 33 def world raise "World expected but not set for the work item #{self}" unless @world @world end |
#world=(world) ⇒ Object
the world to be used for execution purposes of the step. Setting it separately and explicitly as the world can’t be serialized
40 41 42 |
# File 'lib/dynflow/director.rb', line 40 def world=(world) @world = world end |