Class: Conductor::Worker::Events::PollStarted

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

Overview

Published when polling 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:, worker_id:, poll_count:) ⇒ PollStarted

Returns a new instance of PollStarted.

Parameters:

  • task_type (String)

    Task definition name

  • worker_id (String)

    Unique worker identifier

  • poll_count (Integer)

    Number of polls performed



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_countInteger (readonly)

Returns Number of polls performed so far.

Returns:

  • (Integer)

    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_idString (readonly)

Returns Unique worker identifier.

Returns:

  • (String)

    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_hObject



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