Class: Merb::Rack::SwiftipliedMongrel

Inherits:
Mongrel show all
Defined in:
lib/merb-core/rack/adapter/swiftiplied_mongrel.rb

Class Method Summary collapse

Class Method Details

.start(opts = {}) ⇒ Object

Starts Mongrel as swift.

Parameters

opts<Hash>

Options for Mongrel (see below).

Options (opts)

:host<String>

The hostname that Mongrel should serve.

:port<Fixnum>

The port Mongrel should bind to.

:app<String>>

The application name.



16
17
18
19
20
21
22
23
# File 'lib/merb-core/rack/adapter/swiftiplied_mongrel.rb', line 16

def self.start(opts={})
  Merb.logger.warn!("Using SwiftipliedMongrel adapter")
  Merb::Dispatcher.use_mutex = false
  server = ::Mongrel::HttpServer.new(opts[:host], opts[:port].to_i)
  Merb::Server.change_privilege
  server.register('/', ::Merb::Rack::Handler::Mongrel.new(opts[:app]))
  server.run.join
end