Class: MissionControl::Jobs::Application

Inherits:
Object
  • Object
show all
Includes:
IdentifiedByName
Defined in:
lib/mission_control/jobs/application.rb

Overview

An application containing backend jobs servers

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from IdentifiedByName

#id

Constructor Details

#initialize(name:) ⇒ Application

Returns a new instance of Application.



7
8
9
10
# File 'lib/mission_control/jobs/application.rb', line 7

def initialize(name:)
  super
  @servers = MissionControl::Jobs::IdentifiedElements.new
end

Instance Attribute Details

#serversObject (readonly)

Returns the value of attribute servers.



5
6
7
# File 'lib/mission_control/jobs/application.rb', line 5

def servers
  @servers
end

Instance Method Details

#add_servers(queue_adapters_by_name) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/mission_control/jobs/application.rb', line 12

def add_servers(queue_adapters_by_name)
  queue_adapters_by_name.each do |name, queue_adapter|
    adapter, cleaner = queue_adapter

    servers << MissionControl::Jobs::Server.new(name: name.to_s, queue_adapter: adapter,
      backtrace_cleaner: cleaner, application: self)
  end
end