Class: Merb::Rack::Mongrel

Inherits:
AbstractAdapter show all
Defined in:
lib/merb-core/rack/adapter/mongrel.rb

Direct Known Subclasses

EventedMongrel, SwiftipliedMongrel

Class Method Summary collapse

Methods inherited from AbstractAdapter

exit_process, process_title, spawn_worker, start, start_at_port

Class Method Details

.new_server(port) ⇒ Object

:api: plugin



31
32
33
# File 'lib/merb-core/rack/adapter/mongrel.rb', line 31

def self.new_server(port)
  @server = ::Mongrel::HttpServer.new(@opts[:host], port)
end

.start_serverObject

:api: plugin



36
37
38
39
# File 'lib/merb-core/rack/adapter/mongrel.rb', line 36

def self.start_server
  @server.register('/', ::Merb::Rack::Handler::Mongrel.new(@opts[:app]))
  @server.run.join
end

.stop(status = 0) ⇒ Object

:api: plugin



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/merb-core/rack/adapter/mongrel.rb', line 18

def self.stop(status = 0)
  if @server
    begin
      @server.stop(true)
    rescue Mongrel::TimeoutError
      Merb.logger.fatal! "Your process took too long to shut " \
        "down, so mongrel killed it."
    end
    true
  end
end