The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

FCGI::Async - Module to allow use of FastCGI asynchronously

SYNOPSIS

This module allows a program to respond to FastCGI requests using an asynchronous model. The program would typically be structured as a select() loop.

    use FCGI::Async;

    my $fcgi = FCGI::Async->new();
    
    while( 1 ) {
       $fcgi->select();
       # perform non-blocking tasks here
    }

FUNCTIONS

$fcgi = FCGI::Async->new( %args )

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.

The function operates in one of three ways, depending on arguments passed in the %args hash:

  • 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.

  • 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.

  • 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.

$req = $fcgi->waitingreq

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.

See FCGI::Async::Request for more details.

SEE ALSO

  • CGI::Fast - Fast CGI drop-in replacement of CGI; single-threaded, blocking mode.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 203:

You forgot a '=back' before '=head1'

Around line 207:

=back without =over