Class: Minus5::Daemon::EmBase

Inherits:
Object
  • Object
show all
Defined in:
lib/minus5_daemon/em_base.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, logger) ⇒ EmBase

Returns a new instance of EmBase.



9
10
11
12
# File 'lib/minus5_daemon/em_base.rb', line 9

def initialize(options, logger)
  @options = options
  @logger = logger
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/minus5_daemon/em_base.rb', line 14

def run
  EventMachine.run do
    self.em_run
    logger.debug "em - server started"
    Signal.trap("TERM") do
      logger.debug "em - TERM signal received"
      EventMachine::stop_event_loop
      EventMachine::stop
    end
  end
end