Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a rack handler do exactly?

Tags:

ruby

rack

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?

like image 315
David K. Avatar asked Oct 15 '22 03:10

David K.


1 Answers

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.

like image 158
Ignacio Vazquez-Abrams Avatar answered Oct 18 '22 14:10

Ignacio Vazquez-Abrams