Sha256: add60aedba908c29116a3dfc0d3f393361ccc0ffb75d7db397d30fa280d3f23c
Contents?: true
Size: 722 Bytes
Versions: 5
Compression:
Stored size: 722 Bytes
Contents
# encoding: utf-8 require 'eventmachine' require 'servolux' require 'thread' module Servolux class EventMachineServer < Server def initialize(name, opts = {}) super EventMachine.error_handler do |e| $log.exception(e) raise e end end def before_starting @reactor = Thread.new do begin EventMachine.run { boot if respond_to?(:boot) } rescue => e $log.exception(e) end end end def after_stopping $log.debug("eventmachine stop") EventMachine.stop_event_loop if EventMachine.reactor_running? @reactor.kill @reactor.join if @reactor.is_a?(Thread) end def run end end end
Version data entries
5 entries across 5 versions & 1 rubygems