Class: Conductor::Worker::Events::PollFailure
- Inherits:
-
TaskRunnerEvent
- Object
- ConductorEvent
- TaskRunnerEvent
- Conductor::Worker::Events::PollFailure
- Defined in:
- lib/conductor/worker/events/task_runner_events.rb
Overview
Published when polling fails
Instance Attribute Summary collapse
-
#cause ⇒ Exception
readonly
The exception that caused the failure.
-
#duration_ms ⇒ Float
readonly
Duration of poll in milliseconds.
Attributes inherited from TaskRunnerEvent
Attributes inherited from ConductorEvent
Instance Method Summary collapse
-
#initialize(task_type:, duration_ms:, cause:) ⇒ PollFailure
constructor
A new instance of PollFailure.
- #to_h ⇒ Object
Constructor Details
#initialize(task_type:, duration_ms:, cause:) ⇒ PollFailure
Returns a new instance of PollFailure.
60 61 62 63 64 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 60 def initialize(task_type:, duration_ms:, cause:) super(task_type: task_type) @duration_ms = duration_ms @cause = cause end |
Instance Attribute Details
#cause ⇒ Exception (readonly)
Returns The exception that caused the failure.
55 56 57 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 55 def cause @cause end |
#duration_ms ⇒ Float (readonly)
Returns Duration of poll in milliseconds.
53 54 55 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 53 def duration_ms @duration_ms end |
Instance Method Details
#to_h ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 66 def to_h super.merge( duration_ms: @duration_ms, cause: @cause.class.name, cause_message: @cause. ) end |