tags:

views:

43

answers:

1

What does a rack handler do exactly, i.e. can someone explain in pseudo-code the steps that a rack handler takes to deliver a result for a request?

+1  A: 

It processes the HTTP request headers and content, instantiating a Request object. It then passes the Request object through the middleware then to the rack application. The rack application instantiates a Response object and sends it back up through the middleware, and the hander turns it into HTTP response headers and content.

Ignacio Vazquez-Abrams
This is great but I have one more little question. So is the handler technically a server or does the server forward the request to the handler which then responds back to the server?
davidk01
It depends on which handler you use. The FCGI handler communicates with the web server over a socket. mod_passenger actually becomes part of httpd or nginx.
Ignacio Vazquez-Abrams
Great. Thanks for the concise and clear answer.
davidk01