Class: Conductor::Worker::Events::ActiveWorkersChanged

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

Overview

Published when the active-worker count changes for a task type

Instance Attribute Summary collapse

Attributes inherited from TaskRunnerEvent

#task_type

Attributes inherited from ConductorEvent

#timestamp

Instance Method Summary collapse

Constructor Details

#initialize(task_type:, count:) ⇒ ActiveWorkersChanged

Returns a new instance of ActiveWorkersChanged.



260
261
262
263
# File 'lib/conductor/worker/events/task_runner_events.rb', line 260

def initialize(task_type:, count:)
  super(task_type: task_type)
  @count = count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



258
259
260
# File 'lib/conductor/worker/events/task_runner_events.rb', line 258

def count
  @count
end

Instance Method Details

#to_hObject



265
266
267
# File 'lib/conductor/worker/events/task_runner_events.rb', line 265

def to_h
  super.merge(count: @count)
end