Class: Minus5::Daemon::EmBase
- Inherits:
-
Object
- Object
- Minus5::Daemon::EmBase
- Defined in:
- lib/minus5_daemon/em_base.rb
Instance Method Summary collapse
-
#initialize(options, logger) ⇒ EmBase
constructor
A new instance of EmBase.
- #run ⇒ Object
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(, logger) @options = @logger = logger end |
Instance Method Details
#run ⇒ Object
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 |