AnyEvent::FCGI(3pm)

AnyEvent::FCGI3pm

Non-blocking fastcgi server

Usage

    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;

Overview

This module implements non-blocking FastCGI server for event based applications.

Methods

new

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

port => $port

The TCP port the FastCGI server will listen on.

host => $host

The TCP address of the FastCGI server will listen on. If undefined 0.0.0.0 will be used.

socket => $path

Path to UNIX domain socket to listen. If specified, "host" and "port" parameters ignored.

on_request => sub { }

Reference to a handler to call when a new FastCGI request is received. It will be invoked as

    $on_request->($request)

where $request will be a new AnyEvent::FCGI::Request object.

backlog => $backlog

Optional. Integer number of socket backlog (listen queue)

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9–10
  2. 11
  3. 12–13

License

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

Author

Vitaly Kramskikh, <[email protected]>

From libanyevent-fcgi-perl 0.04-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.