Class: Conductor::Worker::Events::TaskUpdateCompleted

Inherits:
TaskRunnerEvent show all
Defined in:
lib/conductor/worker/events/task_runner_events.rb

Overview

Published when task update completes successfully

Instance Attribute Summary collapse

Attributes inherited from TaskRunnerEvent

#task_type

Attributes inherited from ConductorEvent

#timestamp

Instance Method Summary collapse

Constructor Details

#initialize(task_type:, task_id:, worker_id:, workflow_instance_id:, duration_ms:) ⇒ TaskUpdateCompleted

Returns a new instance of TaskUpdateCompleted.



194
195
196
197
198
199
200
# File 'lib/conductor/worker/events/task_runner_events.rb', line 194

def initialize(task_type:, task_id:, worker_id:, workflow_instance_id:, duration_ms:)
  super(task_type: task_type)
  @task_id = task_id
  @worker_id = worker_id
  @workflow_instance_id = workflow_instance_id
  @duration_ms = duration_ms
end

Instance Attribute Details

#duration_msObject (readonly)

Returns the value of attribute duration_ms.



192
193
194
# File 'lib/conductor/worker/events/task_runner_events.rb', line 192

def duration_ms
  @duration_ms
end

#task_idObject (readonly)

Returns the value of attribute task_id.



192
193
194
# File 'lib/conductor/worker/events/task_runner_events.rb', line 192

def task_id
  @task_id
end

#worker_idObject (readonly)

Returns the value of attribute worker_id.



192
193
194
# File 'lib/conductor/worker/events/task_runner_events.rb', line 192

def worker_id
  @worker_id
end

#workflow_instance_idObject (readonly)

Returns the value of attribute workflow_instance_id.



192
193
194
# File 'lib/conductor/worker/events/task_runner_events.rb', line 192

def workflow_instance_id
  @workflow_instance_id
end

Instance Method Details

#to_hObject



202
203
204
205
206
207
# File 'lib/conductor/worker/events/task_runner_events.rb', line 202

def to_h
  super.merge(
    task_id: @task_id, worker_id: @worker_id,
    workflow_instance_id: @workflow_instance_id, duration_ms: @duration_ms
  )
end