FCGI::Async - Module to allow use of FastCGI asynchronously
This module allows a program to respond to FastCGI requests using an asynchronous model. The program would typically be structured as a select() loop.
select()
use FCGI::Async; my $fcgi = FCGI::Async->new(); while( 1 ) { $fcgi->select(); # perform non-blocking tasks here }
This function returns a new instance of a FCGI::Async object, containing a master socket to listen on. The constructor returns immediately; it does not make any blocking calls.
FCGI::Async
The function operates in one of three ways, depending on arguments passed in the %args hash:
%args
Listening on an existing socket.
socket => $socket
This must be a socket opened in listening mode, derived from IO::Socket, or any other class that handles the fileno and accept methods in a similar way.
IO::Socket
fileno
accept
Creating a new listening socket.
port => $port
A new IO::Socket::INET socket will be opened on the given port number. It will listen on all interfaces, from all addresses.
IO::Socket::INET
Using the socket passed as STDIN from a webserver.
When running a local FastCGI responder, the webserver will create a new INET socket connected to the script's STDIN file handle. To use the socket in this case, pass neither of the above options.
This method obtains a FCGI::Async::Request object that is ready for some operation to be performed on it. If no request is ready, this method will return undef.
FCGI::Async::Request
undef
See FCGI::Async::Request for more details.
CGI::Fast - Fast CGI drop-in replacement of CGI; single-threaded, blocking mode.
Paul Evans <leonerd@leonerd.org.uk>
2 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
=back without =over
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.