AnyEvent::FCGI(3pm) | User Contributed Perl Documentation | AnyEvent::FCGI(3pm) |
AnyEvent::FCGI - non-blocking FastCGI server
use AnyEvent; use AnyEvent::FCGI; my $fcgi = new AnyEvent::FCGI( port => 9000, on_request => sub { my $request = shift; $request->respond( 'OH HAI! QUERY_STRING is ' . $request->param('QUERY_STRING'), 'Content-Type' => 'text/plain', ); } ); my $timer = AnyEvent->timer( after => 10, interval => 0, cb => sub { # shut down server after 10 seconds $fcgi = undef; } ); AnyEvent->loop;
This module implements non-blocking FastCGI server for event based applications.
This function creates a new FastCGI server and returns a new instance of a "AnyEvent::FCGI" object. To shut down the server just remove all references to this object.
PARAMETERS
$on_request->($request)
where $request will be a new AnyEvent::FCGI::Request object.
AnyEvent, AnyEvent::FCGI::Request
This module based on FCGI::Async and FCGI::EV.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
Vitaly Kramskikh, <vkramskih@cpan.org>
2022-10-14 | perl v5.34.0 |