VirtualRequests » History » Revision 4

Revision 3 (stbuehler, 2008-12-22 16:27) → Revision 4/5 (presbrey, 2012-02-06 17:55)

h1. VirtualRequests 


 One request may need several sub requests; fastcgi defines 3 roles for backends which i would use here too (with a little bit different interpretation): 
 * Authorizer: doesn't see the request content; request handling waits until result is available 
   This one is the same as the fastcgi authorizer. 

   Implementation: @authorize actionblock @ 
   * make a virtual request, copy the "request" into it 
   * wait for response headers; if status = 200: drop content and go on 
     else forward content and response headers  

 * Responder: generates the content 
 * Filter: a response filter 

 h2. Basic Structure 

 * callbacks set by the master of a request: 

   * handle_request_headers 
   * handle_response_headers 
   * handle_response_body 
   * handle_response_error 
 * callbacks set by the content handler via vrequest_handle_indirect: 

   * handle_request_body 
 * use vrequest_handle_direct if you don't need extra handling (like reading the request-body)