| 1 |
NAME |
| 2 |
"FCGI::Async" - use FastCGI with IO::Async |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use FCGI::Async; |
| 6 |
use IO::Async::Loop; |
| 7 |
|
| 8 |
my $loop = IO::Async::Loop->new(); |
| 9 |
|
| 10 |
my $fcgi = FCGI::Async->new( |
| 11 |
loop => $loop |
| 12 |
service => 1234, |
| 13 |
|
| 14 |
on_request => sub { |
| 15 |
my ( $fcgi, $req ) = @_; |
| 16 |
|
| 17 |
# Handle the request here |
| 18 |
} |
| 19 |
); |
| 20 |
|
| 21 |
$loop->loop_forever; |
| 22 |
|
| 23 |
DESCRIPTION |
| 24 |
This subclass of Net::Async::FastCGI provides a slightly different API; |
| 25 |
where it can take an argument containing the IO::Async::Loop object, |
| 26 |
rather than be added as "Notifier" object within one. It is provided |
| 27 |
mostly as a backward-compatibility wrapper for older code using this |
| 28 |
interface; newer code ought to use the "Net::Async::FastCGI" interface |
| 29 |
directly. |
| 30 |
|
| 31 |
CONSTRUCTOR |
| 32 |
$fcgi = FCGI::Async->new( %args ) |
| 33 |
Returns a new instance of a "FCGI::Async" object. |
| 34 |
|
| 35 |
If either a "handle" or "service" argument are passed to the |
| 36 |
constructor, then the newly-created object is added to the given |
| 37 |
"IO::Async::Loop", then the "listen" method is invoked, passing the |
| 38 |
entire %args hash to it. |
| 39 |
|
| 40 |
If either of the above arguments are given, then a "IO::Async::Loop" |
| 41 |
must also be provided: |
| 42 |
|
| 43 |
loop => IO::Async::Loop |
| 44 |
A reference to the "IO::Async::Loop" which will contain the |
| 45 |
listening sockets. |
| 46 |
|
| 47 |
AUTHOR |
| 48 |
Paul Evans <[email protected]> |
| 49 |
|