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.
28 29 30 31 32 |
# File 'lib/dynflow/director.rb', line 28 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.
26 27 28 |
# File 'lib/dynflow/director.rb', line 26 def execution_plan_id @execution_plan_id end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
26 27 28 |
# File 'lib/dynflow/director.rb', line 26 def queue @queue end |
#sender_orchestrator_id ⇒ Object (readonly)
Returns the value of attribute sender_orchestrator_id.
26 27 28 |
# File 'lib/dynflow/director.rb', line 26 def sender_orchestrator_id @sender_orchestrator_id end |
Class Method Details
.new_from_hash(hash, *_args) ⇒ Object
56 57 58 |
# File 'lib/dynflow/director.rb', line 56 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
45 46 47 |
# File 'lib/dynflow/director.rb', line 45 def execute raise NotImplementedError end |
#to_hash ⇒ Object
49 50 51 52 53 54 |
# File 'lib/dynflow/director.rb', line 49 def to_hash { class: self.class.name, execution_plan_id: execution_plan_id, queue: queue, sender_orchestrator_id: sender_orchestrator_id } end |
#world ⇒ Object
34 35 36 37 |
# File 'lib/dynflow/director.rb', line 34 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
41 42 43 |
# File 'lib/dynflow/director.rb', line 41 def world=(world) @world = world end |