FCGI::Async::PSGI - use PSGI applications with FCGI::Async
FCGI::Async::PSGI
PSGI
FCGI::Async
use FCGI::Async::PSGI; use IO::Async::Loop; my $loop = IO::Async::Loop->new; my $fcgi = FCGI::Async::PSGI->new( port => 12345, app => sub { my $env = shift; return [ 200, [ "Content-Type" => "text/plain" ], [ "Hello, world!" ], ]; }, ); $loop->add( $fcgi ); $loop->loop_forever;
This subclass of FCGI::Async allows a FastCGI responder to use a PSGI application to respond to requests. It acts as a gateway between the FastCGI connection from the webserver, and the PSGI application. Aside from the use of PSGI instead of the on_request callback, this class behaves similarly to FCGI::Async.
on_request
The following named parameters may be passed to new or configure:
new
configure
Reference to the actual PSGI application to use for responding to requests
The following extra keys are supplied to the environment of the PSGI app:
fcgi.async
The FCGI::Async::PSGI object serving the request
fcgi.async.req
The FCGI::Async::Request object representing this particular request
io.async.loop
The IO::Async::Loop object that the FCGI::Async::PSGI object is a member of. This is also provided as fcgi.async.loop for backward-compatibility with version 0.21, but at some point will be removed.
fcgi.async.loop
PSGI - Perl Web Server Gateway Interface Specification
Plack::Handler::FCGI::Async - FastCGI handler for Plack using FCGI::Async
Paul Evans <leonerd@leonerd.org.uk>
To install FCGI::Async, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FCGI::Async
CPAN shell
perl -MCPAN -e shell install FCGI::Async
For more information on module installation, please visit the detailed CPAN module installation guide.