Class: Apprentice::Sentinel
- Inherits:
-
Object
- Object
- Apprentice::Sentinel
- Includes:
- Configuration, Server
- Defined in:
- lib/apprentice.rb
Instance Method Summary collapse
-
#initialize ⇒ Sentinel
constructor
A new instance of Sentinel.
- #run ⇒ Object
Methods included from Configuration
Constructor Details
#initialize ⇒ Sentinel
Returns a new instance of Sentinel.
11 12 13 |
# File 'lib/apprentice.rb', line 11 def initialize @options = get_config end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/apprentice.rb', line 15 def run EM.run do Signal.trap('INT') { EventMachine.stop } Signal.trap('TERM') { EventMachine.stop } EventMachine.start_server( @options.ip, @options.port, Server::EventServer, @options ) end end |