Class: Mongrel::HttpHandler
- Inherits:
-
Object
- Object
- Mongrel::HttpHandler
- Defined in:
- lib/mongrel/handlers.rb
Overview
You implement your application handler with this. It’s very light giving just the minimum necessary for you to handle a request and shoot back a response. Look at the HttpRequest and HttpResponse objects for how to use them.
This is used for very simple handlers that don’t require much to operate. More extensive plugins or those you intend to distribute as GemPlugins should be implemented using the HttpHandlerPlugin mixin.
Direct Known Subclasses
Camping::CampingHandler, DeflateFilter, DirHandler, Error404Handler, Rails::RailsHandler, RedirectHandler, StatisticsFilter, StatusHandler
Instance Attribute Summary collapse
-
#listener ⇒ Object
Returns the value of attribute listener.
-
#request_notify ⇒ Object
readonly
Returns the value of attribute request_notify.
Instance Method Summary collapse
- #process(request, response) ⇒ Object
-
#request_begins(params) ⇒ Object
This will be called by Mongrel if HttpHandler.request_notify set to true.
-
#request_progress(params, clen, total) ⇒ Object
Called by Mongrel for each IO chunk that is received on the request socket from the client, allowing you to track the progress of the IO and monitor the input.
Instance Attribute Details
#listener ⇒ Object
Returns the value of attribute listener.
24 25 26 |
# File 'lib/mongrel/handlers.rb', line 24 def listener @listener end |
#request_notify ⇒ Object (readonly)
Returns the value of attribute request_notify.
23 24 25 |
# File 'lib/mongrel/handlers.rb', line 23 def request_notify @request_notify end |
Instance Method Details
#process(request, response) ⇒ Object
39 40 |
# File 'lib/mongrel/handlers.rb', line 39 def process(request, response) end |
#request_begins(params) ⇒ Object
This will be called by Mongrel if HttpHandler.request_notify set to true. You only get the parameters for the request, with the idea that you’d “bound” the beginning of the request processing and the first call to process.
29 30 |
# File 'lib/mongrel/handlers.rb', line 29 def request_begins(params) end |
#request_progress(params, clen, total) ⇒ Object
Called by Mongrel for each IO chunk that is received on the request socket from the client, allowing you to track the progress of the IO and monitor the input. This will be called by Mongrel only if HttpHandler.request_notify set to true.
36 37 |
# File 'lib/mongrel/handlers.rb', line 36 def request_progress(params, clen, total) end |