Class: Conductor::Worker::Events::TaskExecutionFailure
- Inherits:
-
TaskRunnerEvent
- Object
- ConductorEvent
- TaskRunnerEvent
- Conductor::Worker::Events::TaskExecutionFailure
- Defined in:
- lib/conductor/worker/events/task_runner_events.rb
Overview
Published when task execution fails
Instance Attribute Summary collapse
-
#cause ⇒ Exception
readonly
The exception that caused the failure.
-
#duration_ms ⇒ Float
readonly
Duration of execution in milliseconds.
-
#is_retryable ⇒ Boolean
readonly
Whether the error is retryable.
-
#task_id ⇒ String
readonly
Unique task identifier.
-
#worker_id ⇒ String
readonly
Unique worker identifier.
-
#workflow_instance_id ⇒ String
readonly
Workflow instance identifier.
Attributes inherited from TaskRunnerEvent
Attributes inherited from ConductorEvent
Instance Method Summary collapse
-
#initialize(task_type:, task_id:, worker_id:, workflow_instance_id:, duration_ms:, cause:, is_retryable: true) ⇒ TaskExecutionFailure
constructor
A new instance of TaskExecutionFailure.
- #to_h ⇒ Object
Constructor Details
#initialize(task_type:, task_id:, worker_id:, workflow_instance_id:, duration_ms:, cause:, is_retryable: true) ⇒ TaskExecutionFailure
Returns a new instance of TaskExecutionFailure.
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 166 def initialize(task_type:, task_id:, worker_id:, workflow_instance_id:, duration_ms:, cause:, is_retryable: true) super(task_type: task_type) @task_id = task_id @worker_id = worker_id @workflow_instance_id = workflow_instance_id @duration_ms = duration_ms @cause = cause @is_retryable = is_retryable end |
Instance Attribute Details
#cause ⇒ Exception (readonly)
Returns The exception that caused the failure.
155 156 157 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 155 def cause @cause end |
#duration_ms ⇒ Float (readonly)
Returns Duration of execution in milliseconds.
153 154 155 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 153 def duration_ms @duration_ms end |
#is_retryable ⇒ Boolean (readonly)
Returns Whether the error is retryable.
157 158 159 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 157 def is_retryable @is_retryable end |
#task_id ⇒ String (readonly)
Returns Unique task identifier.
147 148 149 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 147 def task_id @task_id end |
#worker_id ⇒ String (readonly)
Returns Unique worker identifier.
149 150 151 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 149 def worker_id @worker_id end |
#workflow_instance_id ⇒ String (readonly)
Returns Workflow instance identifier.
151 152 153 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 151 def workflow_instance_id @workflow_instance_id end |
Instance Method Details
#to_h ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 177 def to_h super.merge( task_id: @task_id, worker_id: @worker_id, workflow_instance_id: @workflow_instance_id, duration_ms: @duration_ms, cause: @cause.class.name, cause_message: @cause., is_retryable: @is_retryable ) end |