.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Twiggy 3pm" .TH Twiggy 3pm "2021-01-24" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Twiggy \- AnyEvent HTTP server for PSGI .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& twiggy \-\-listen :8080 .Ve .PP See \f(CW\*(C`twiggy \-h\*(C'\fR for more details. .PP .Vb 1 \& use Twiggy::Server; \& \& my $server = Twiggy::Server\->new( \& host => $host, \& port => $port, \& ); \& $server\->register_service($app); \& \& AE::cv\->recv; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Twiggy is a lightweight and fast \s-1HTTP\s0 server with unique features such as: .IP "\s-1PSGI\s0" 4 .IX Item "PSGI" Can run any \s-1PSGI\s0 applications. Fully supports \fIpsgi.nonblocking\fR and \&\fIpsgi.streaming\fR interfaces. .IP "AnyEvent" 4 .IX Item "AnyEvent" This server uses AnyEvent and runs in a non-blocking event loop, so it's best to run event-driven web applications that runs I/O bound jobs or delayed responses such as long-poll, WebSocket or streaming content (server push). .Sp This software used to be called Plack::Server::AnyEvent but was renamed to Twiggy. .IP "Fast header parser" 4 .IX Item "Fast header parser" Uses \s-1XS/C\s0 based \s-1HTTP\s0 header parser for the best performance. (optional, install the HTTP::Parser::XS module to enable it; see also Plack::HTTPParser for more information). .IP "Lightweight and Fast" 4 .IX Item "Lightweight and Fast" The memory required to run twiggy is 6MB and it can serve more than 4500 req/s with a single process on Perl 5.10 with MacBook Pro 13" late 2009. .IP "Superdaemon aware" 4 .IX Item "Superdaemon aware" Supports Server::Starter for hot deploy and graceful restarts. .Sp To use it, instead of the usual: .Sp .Vb 1 \& plackup \-\-server Twiggy \-\-port 8111 app.psgi .Ve .Sp install Server::Starter and use: .Sp .Vb 1 \& start_server \-\-port 8111 \-\- plackup \-\-server Twiggy app.psgi .Ve .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" The following environment variables are supported. .IP "\s-1TWIGGY_DEBUG\s0" 4 .IX Item "TWIGGY_DEBUG" Set to true to enable debug messages from Twiggy. .SH "LICENSE" .IX Header "LICENSE" This module is licensed under the same terms as Perl itself. .SH "AUTHOR" .IX Header "AUTHOR" Tatsuhiko Miyagawa .PP Tokuhiro Matsuno .PP Yuval Kogman .PP Hideki Yamamura .PP Daisuke Maki .SH "SEE ALSO" .IX Header "SEE ALSO" Plack AnyEvent Tatsumaki