Class: Rack::Handler::Reel
- Inherits:
-
Object
- Object
- Rack::Handler::Reel
- Defined in:
- lib/rack/handler/reel.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :host => "0.0.0.0", :port => 3000, :quiet => false }
Class Method Summary collapse
Class Method Details
.run(app, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rack/handler/reel.rb', line 12 def self.run(app, = {}) = DEFAULT_OPTIONS.merge() app = Rack::CommonLogger.new(app, STDOUT) unless [:quiet] ENV['RACK_ENV'] = [:environment].to_s if [:environment] supervisor = ::Reel::Rack::Server.supervise_as(:reel_rack_server, app, ) begin sleep rescue Interrupt Celluloid.logger.info "Interrupt received... shutting down" supervisor.terminate end end |