Class: Vines::Services::Component
- Inherits:
-
Object
- Object
- Vines::Services::Component
- 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
-
#initialize(config) ⇒ Component
constructor
A new instance of Component.
- #start ⇒ Object
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
#start ⇒ Object
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 |