Net::A...I::PSGI(3pm)
β¨ NAME β¨
ok so bestie, meet Net::Async::FastCGI::PSGI β it's the little icon that lets you use PSGI applications with Net::Async::FastCGI. no cap. π
πΈ SYNOPSIS πΈ
like, here's the whole vibe in one go:
use Net::Async::FastCGI::PSGI;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my $fcgi = Net::Async::FastCGI::PSGI->new(
port => 12345,
app => sub {
my $env = shift;
return [
200,
[ "Content-Type" => "text/plain" ],
[ "Hello, world!" ],
];
},
);
$loop->add( $fcgi );
$loop->run;
look at her go π¦ she's serving hello world and looking stunning doing it.
π DESCRIPTION π
okay so real talk: this is a subclass of Net::Async::FastCGI, and what she does is let a FastCGI responder use a PSGI application to respond to requests. she's literally the gateway bestie between the FastCGI connection coming in from the webserver and the PSGI application on the other side. π«Ά
the one thing that's different? instead of the on_request event, you get PSGI. that's it. aside from that glow-up, this class behaves similarly to Net::Async::FastCGI. same energy, new fit. β¨
π PARAMETERS π
these named parameters can be passed to new or configure, iykyk:
app => CODEβ a reference to the actualPSGIapplication you want to use for responding to requests. yes, it's a coderef. yes, it's the main character. π
π PSGI ENVIRONMENT π
the environment of the PSGI app gets these extra keys handed to it, and they're lowkey essential:
"net.async.fastcgi"β theNet::Async::FastCGI::PSGIobject that's serving the request. it's giving selfie πΈ"net.async.fastcgi.req"β theNet::Async::FastCGI::Requestobject representing this particular request. every request gets her own moment. π«"io.async.loop"β theIO::Async::Loopobject that theNet::Async::FastCGI::PSGIobject is a member of. found family fr fr. π§
β SEE ALSO β
- PSGI - Perl Web Server Gateway Interface Specification
- Plack::Handler::Net::Async::FastCGI - FastCGI handler for Plack using Net::Async::FastCGI
go read those, bestie, they're part of the lore π
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk>
and that's the whole page, no crumbs left π this one's from perl v5.38.2, dated 2024-07-29 β written up by the User Contributed Perl Documentation crew. slay, periodt. π β¨
π¦ where this page comes from
- debian trixie: libnet-async-fastcgi-perl 0.26-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-async-fastcgi-perl 0.26-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-async-fastcgi-perl 0.26-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