Class: Vines::Services::Component

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/vines/services/component.rb

Overview

The main starting point for the Vines Services component process. Starts the EventMachine processing loop and registers the component with the configured upstream servers.

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Component

Returns a new instance of Component.



11
12
13
# File 'lib/vines/services/component.rb', line 11

def initialize(config)
  @config = config
end

Instance Method Details

#startObject



15
16
17
18
19
20
21
22
23
# File 'lib/vines/services/component.rb', line 15

def start
  log.info('Vines component started')
  at_exit { log.fatal('Vines component stopped') }
  EM.epoll
  EM.kqueue
  EM.run do
    @config.hosts.each {|host| host.start }
  end
end