Class: MongrelCGIWrapper

Inherits:
Mongrel::HttpHandler
  • Object
show all
Defined in:
lib/lapillus/mongrel_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(application) ⇒ MongrelCGIWrapper

Returns a new instance of MongrelCGIWrapper.



38
39
40
41
42
# File 'lib/lapillus/mongrel_server.rb', line 38

def initialize(application)
  super()
  @application = application
  ActiveRecord::Base.allow_concurrency=true
end

Instance Method Details

#process(request, response) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/lapillus/mongrel_server.rb', line 44

def process(request, response)
  cgi = Mongrel::CGIWrapper.new(request, response) 
  begin  
    Dispatcher.dispatch(cgi,@application)
  rescue => e
    STDERR.puts e
    STDERR.puts e.backtrace.join("\n")
  ensure
    ActiveRecord::Base.clear_active_connections!
  end
end