Show
Ignore:
Timestamp:
05/02/08 13:54:27 (5 years ago)
Author:
daisuke
Message:

update Interface role docs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-Engine/branches/moose/lib/HTTP/Engine/Role/Interface.pm

    r10913 r10926  
    44with 'MooseX::Object::Pluggable'; 
    55 
    6 requires 'run'; 
     6requires qw(run prepare_request finalize_response); 
    77 
    88has handler => ( 
     
    1313 
    14141; 
     15 
     16__END__ 
     17 
     18=head1 NAME 
     19 
     20HTTP::Engine::Role::Interface - The Interface Role Definition 
     21 
     22=head1 SYNOPSIS 
     23 
     24  package HTTP::Engine::Interface::CGI; 
     25  use Moose; 
     26  with 'HTTP::Engine::Role::Interface'; 
     27 
     28=head1 DESCRIPTION 
     29 
     30HTTP::Engine::Role::Interface defines the role of an interface in HTTP::Engine. 
     31 
     32Specifically, an Interface in HTTP::Engine needs to do at least two things: 
     33 
     34=over 4 
     35 
     36=item Create a HTTP::Engine::Request object from the client request 
     37 
     38If you are on a CGI environment, you need to receive all the data from  
     39%ENV and such. If you are running on a mod_perl process, you need to muck 
     40with $r.  
     41 
     42In any case, you need to construct a valid HTTP::Engine::Request object 
     43so the application handler can do the real work. 
     44 
     45=item Accept a HTTP::Engine::Response object, send it back to the client 
     46 
     47The application handler must return an HTTP::Engine::Response object. 
     48 
     49In turn, the interface needs to do whatever necessary to present this 
     50object to the client. In a  CGI environment, you would write to STDOUT. 
     51In mod_perl, you need to call the appropriate $r->headers methods and/or 
     52$r->print 
     53 
     54=back 
     55 
     56=cut