Class: Conductor::Worker::Events::PollCompleted
- Inherits:
-
TaskRunnerEvent
- Object
- ConductorEvent
- TaskRunnerEvent
- Conductor::Worker::Events::PollCompleted
- Defined in:
- lib/conductor/worker/events/task_runner_events.rb
Overview
Published when polling completes successfully
Instance Attribute Summary collapse
-
#duration_ms ⇒ Float
readonly
Duration of poll in milliseconds.
-
#tasks_received ⇒ Integer
readonly
Number of tasks received.
Attributes inherited from TaskRunnerEvent
Attributes inherited from ConductorEvent
Instance Method Summary collapse
-
#initialize(task_type:, duration_ms:, tasks_received:) ⇒ PollCompleted
constructor
A new instance of PollCompleted.
- #to_h ⇒ Object
Constructor Details
#initialize(task_type:, duration_ms:, tasks_received:) ⇒ PollCompleted
Returns a new instance of PollCompleted.
39 40 41 42 43 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 39 def initialize(task_type:, duration_ms:, tasks_received:) super(task_type: task_type) @duration_ms = duration_ms @tasks_received = tasks_received end |
Instance Attribute Details
#duration_ms ⇒ Float (readonly)
Returns Duration of poll in milliseconds.
32 33 34 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 32 def duration_ms @duration_ms end |
#tasks_received ⇒ Integer (readonly)
Returns Number of tasks received.
34 35 36 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 34 def tasks_received @tasks_received end |
Instance Method Details
#to_h ⇒ Object
45 46 47 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 45 def to_h super.merge(duration_ms: @duration_ms, tasks_received: @tasks_received) end |