Class: Rack::Handler::Rainbows

Inherits:
Object
  • Object
show all
Defined in:
lib/rainbows/rails.rb

Class Method Summary collapse

Class Method Details

.run(app, options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/rainbows/rails.rb', line 13

def run(app, options = {})
  rainbows_options = {}
  rainbows_options[:listeners] = ["#{options[:Host]}:#{options[:Port]}"]
  rainbows_options[:worker_processes] = (ENV["RAINBOWS_WORKERS"] || "1").to_i
  rainbows_options[:timeout] = 31 * 24 * 60 * 60

  ::Rainbows::Launcher.daemonize!(rainbows_options) if options[:daemonize]
  ::Rainbows::HttpServer.new(app, rainbows_options).start.join
end