Class: Conductor::Worker::Events::PollStarted
- Inherits:
-
TaskRunnerEvent
- Object
- ConductorEvent
- TaskRunnerEvent
- Conductor::Worker::Events::PollStarted
- Defined in:
- lib/conductor/worker/events/task_runner_events.rb
Overview
Published when polling starts
Instance Attribute Summary collapse
-
#poll_count ⇒ Integer
readonly
Number of polls performed so far.
-
#worker_id ⇒ String
readonly
Unique worker identifier.
Attributes inherited from TaskRunnerEvent
Attributes inherited from ConductorEvent
Instance Method Summary collapse
-
#initialize(task_type:, worker_id:, poll_count:) ⇒ PollStarted
constructor
A new instance of PollStarted.
- #to_h ⇒ Object
Constructor Details
#initialize(task_type:, worker_id:, poll_count:) ⇒ PollStarted
Returns a new instance of PollStarted.
18 19 20 21 22 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 18 def initialize(task_type:, worker_id:, poll_count:) super(task_type: task_type) @worker_id = worker_id @poll_count = poll_count end |
Instance Attribute Details
#poll_count ⇒ Integer (readonly)
Returns Number of polls performed so far.
13 14 15 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 13 def poll_count @poll_count end |
#worker_id ⇒ String (readonly)
Returns Unique worker identifier.
11 12 13 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 11 def worker_id @worker_id end |
Instance Method Details
#to_h ⇒ Object
24 25 26 |
# File 'lib/conductor/worker/events/task_runner_events.rb', line 24 def to_h super.merge(worker_id: @worker_id, poll_count: @poll_count) end |