lib/alchemy/server.rb
##
# Start listening and processing requests.
Start listening and processing requests.
Start listening and processing requests .
def run
      @stats[:start_time] = Time.now
      @logger = case @opts[:logger]
      when IO, String; Logger.new(@opts[:logger])
      when Logger; @opts[:logger]
      else; Logger.new(STDERR)
      end
      @opts[:list] = Phylactery.new
      @logger.level = @opts[:log_level] || Logger::ERROR
      EventMachine.run do
        EventMachine.epoll
        EventMachine.set_descriptor_table_size(4096)
        EventMachine.start_server(@opts[:host], @opts[:port], Handler, @opts)
      end
    end
def run @stats [ :start_time ] = Time . now @logger = case @opts [ :logger ] when IO , String ; Logger . new ( @opts [ :logger ] ) when Logger ; @opts [ :logger ] else ; Logger . new ( STDERR ) end @opts [ :list ] = Phylactery . new @logger . level = @opts [ :log_level ] || Logger :: ERROR EventMachine . run do EventMachine . epoll EventMachine . set_descriptor_table_size ( 4096 ) EventMachine . start_server ( @opts [ :host ] , @opts [ :port ] , Handler , @opts ) end end
Start listening and processing requests.
Start listening and processing requests .