Class: Dynflow::Director::EventWorkItem
- Inherits:
-
StepWorkItem
- Object
- Serializable
- WorkItem
- StepWorkItem
- Dynflow::Director::EventWorkItem
- Defined in:
- lib/dynflow/director.rb
Constant Summary
Constants inherited from Serializable
Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Attributes inherited from StepWorkItem
Attributes inherited from WorkItem
#execution_plan_id, #queue, #sender_orchestrator_id
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(request_id, execution_plan_id, step, event, queue, sender_orchestrator_id) ⇒ EventWorkItem
constructor
A new instance of EventWorkItem.
- #to_hash ⇒ Object
Methods inherited from WorkItem
Methods inherited from Serializable
Constructor Details
#initialize(request_id, execution_plan_id, step, event, queue, sender_orchestrator_id) ⇒ EventWorkItem
Returns a new instance of EventWorkItem.
88 89 90 91 92 |
# File 'lib/dynflow/director.rb', line 88 def initialize(request_id, execution_plan_id, step, event, queue, sender_orchestrator_id) super(execution_plan_id, step, queue, sender_orchestrator_id) @event = event @request_id = request_id end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
86 87 88 |
# File 'lib/dynflow/director.rb', line 86 def event @event end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
86 87 88 |
# File 'lib/dynflow/director.rb', line 86 def request_id @request_id end |
Class Method Details
.new_from_hash(hash, *_args) ⇒ Object
102 103 104 105 106 107 108 109 |
# File 'lib/dynflow/director.rb', line 102 def self.new_from_hash(hash, *_args) self.new(hash[:request_id], hash[:execution_plan_id], Serializable.from_hash(hash[:step], hash[:execution_plan_id], Dynflow.process_world), Dynflow.serializer.load(hash[:event]), hash[:queue], hash[:sender_orchestrator_id]) end |
Instance Method Details
#execute ⇒ Object
94 95 96 |
# File 'lib/dynflow/director.rb', line 94 def execute @step.execute(@event) end |
#to_hash ⇒ Object
98 99 100 |
# File 'lib/dynflow/director.rb', line 98 def to_hash super.merge(request_id: @request_id, event: Dynflow.serializer.dump(@event)) end |