FCGI::...c::PSGI(3pm)
π FCGI::Async::PSGI π
okay bestie, gather round, because this is the FCGI::Async::PSGI page from the User Contributed Perl Documentation (section 3pm) and it's literally so good. no cap. it's giving "gateway between your webserver and your vibes." β¨
πΈ NAME πΈ
FCGI::Async::PSGI β the way that you can use PSGI applications with FCGI::Async. that's the whole assignment and she ATE. π
π SYNOPSIS π
here's the whole vibe, copy-paste ready, not a single character changed bestie:
use FCGI::Async::PSGI;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $fcgi = FCGI::Async::PSGI->new(
port => 12345,
app => sub {
my $env = shift;
return [
200,
[ "Content-Type" => "text/plain" ],
[ "Hello, world!" ],
];
},
);
$loop->add( $fcgi );
$loop->loop_forever;
like. she's serving a whole Hello, world! on port 12345 and then looping forever like the main character she is. π
π¦ DESCRIPTION π¦
so FCGI::Async::PSGI is a subclass of FCGI::Async, and what she does is let a FastCGI responder use a PSGI application to respond to requests. she is, lowkey, the gateway bestie standing between the FastCGI connection coming from the webserver and the PSGI application. π«Ά
and honestly? aside from using PSGI instead of the on_request callback, this class behaves similarly to FCGI::Async. same energy, new fit. π
β¨ PARAMETERS β¨
you can pass these named parameters to new or to configure β yes, both, she's flexible:
app => CODEβ a reference to the actualPSGIapplication that's gonna do the responding to requests. this is the one, the moment, the icon. π
π PSGI ENVIRONMENT π
these extra keys get supplied to the environment of your PSGI app β freebies, gifts, little treats:
"fcgi.async"β theFCGI::Async::PSGIobject that's serving this request. it's her. π"fcgi.async.req"β theFCGI::Async::Requestobject representing this particular request. iykyk. π"io.async.loop"β theIO::Async::Loopobject that theFCGI::Async::PSGIobject is a member of.
okay important note bestie: that loop is also provided asfcgi.async.loopfor backward-compatibility with version0.21, but at some point it will be removed. so like... don't build your whole personality around it. π
π SEE ALSO π
- PSGI β Perl Web Server Gateway Interface Specification
- Plack::Handler::FCGI::Async β FastCGI handler for Plack using FCGI::Async
πΈ AUTHOR πΈ
Paul Evans <leonerd@leonerd.org.uk> β thank you for your service king π«‘
and that's the page!! brought to you by perl v5.32.0, dated 2021-01-09, straight out of the User Contributed Perl Documentation for FCGI::Async::PSGI(3pm). go forth and serve those requests bestie, periodt. πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: libfcgi-async-perl 0.22-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libfcgi-async-perl 0.22-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libfcgi-async-perl 0.22-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libfcgi-async-perl 0.22-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libfcgi-async-perl 0.22-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfcgi-async-perl 0.22-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms