class Rack::Handler::Reel

Constants

DEFAULT_OPTIONS

Public Class Methods

run(app, options = {}) click to toggle source
# File lib/rack/handler/reel.rb, line 12
def self.run(app, options = {})
  options = DEFAULT_OPTIONS.merge(options)

  app = Rack::CommonLogger.new(app, STDOUT) unless options[:quiet]
  ENV['RACK_ENV'] = options[:environment].to_s if options[:environment]

  supervisor = ::Reel::Rack::Server.supervise_as(:reel_rack_server, app, options)

  begin
    sleep
  rescue Interrupt
    Celluloid.logger.info "Interrupt received... shutting down"
    supervisor.terminate
  end
end