Class: Conductor::Worker::Events::TaskExecutionStarted

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

Overview

Published when task execution starts

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:) ⇒ TaskExecutionStarted

Returns a new instance of TaskExecutionStarted.

Parameters:

  • task_type (String)

    Task definition name

  • task_id (String)

    Unique task identifier

  • worker_id (String)

    Unique worker identifier

  • workflow_instance_id (String)

    Workflow instance identifier



88
89
90
91
92
93
# File 'lib/conductor/worker/events/task_runner_events.rb', line 88

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

Instance Attribute Details

#task_idString (readonly)

Returns Unique task identifier.

Returns:

  • (String)

    Unique task identifier



78
79
80
# File 'lib/conductor/worker/events/task_runner_events.rb', line 78

def task_id
  @task_id
end

#worker_idString (readonly)

Returns Unique worker identifier.

Returns:

  • (String)

    Unique worker identifier



80
81
82
# File 'lib/conductor/worker/events/task_runner_events.rb', line 80

def worker_id
  @worker_id
end

#workflow_instance_idString (readonly)

Returns Workflow instance identifier.

Returns:

  • (String)

    Workflow instance identifier



82
83
84
# File 'lib/conductor/worker/events/task_runner_events.rb', line 82

def workflow_instance_id
  @workflow_instance_id
end

Instance Method Details

#to_hObject



95
96
97
98
99
100
101
# File 'lib/conductor/worker/events/task_runner_events.rb', line 95

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