[Mongrel] More newbie questions.. Calling out to CGI, Reusing Responses, Multi-thread..

Stephen Waits steve at waits.net
Tue Apr 4 17:01:09 EDT 2006


What I'm building is essentially a filter.  On certain URIs, Mongrel 
will handle the request completely.  On other URIs, I'd like to pass 
that responsibility off to an external CGI process (be it Rails's 
dispatch.cgi, or otherwise).  How do I go about that?

Second, I'm finding that in several of my handlers I'd like to reuse a 
response.  However, I couldn't instance a response because it requires a 
socket.  Therefore, I assume it's not meant to work this way.  Possible?

Finally, am I right in thinking that you can run a multi-threaded 
server, albeit with Ruby's cruddy threads, by doing something like this:

     h = Mongrel::HttpServer.new('0.0.0.0', '3000')
     [h.run, h.run, h.run].each { |t| t.join }

Thanks,
Steve



More information about the Mongrel-users mailing list