Twiggy(3pm)

πŸ“¦
version 0.1026 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

✨ NAME ✨

Twiggy β€” an AnyEvent HTTP server for PSGI. Like, it's the whole thing, bestie. That's the vibe. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

okay so from the command line you literally just go:

twiggy --listen :8080

and if you want the whole tea, spill it with:

twiggy -h

and if you're doing the Perl thing (iconic of you), it goes like this:

use Twiggy::Server;

my $server = Twiggy::Server->new(
    host => $host,
    port => $port,
);
$server->register_service($app);

AE::cv->recv;

that last line is doing a LOT of heavy lifting btw, don't forget it πŸ’…


🌸 DESCRIPTION 🌸

Twiggy is a lightweight and fast HTTP server, and it has some unique features that are honestly giving main character energy:

πŸ’« PSGI

It can run any PSGI applications. Fully supports psgi.nonblocking and psgi.streaming interfaces. no cap. 🫢

πŸ¦‹ AnyEvent

This server uses AnyEvent and runs in a non-blocking event loop, so it's bestie-coded for event-driven web applications that run I/O bound jobs or delayed responses β€” think long-poll, WebSocket, or streaming content (server push). ✨

πŸ•°οΈ Fun little history moment: this software used to be called Plack::Server::AnyEvent but was renamed to Twiggy. glow-up fr fr.

⚑ Fast header parser

Uses an XS/C based HTTP header parser for the best performance. (It's optional β€” install the HTTP::Parser::XS module to enable it; see also Plack::HTTPParser for more information). periodt. πŸ”₯

πŸ‘‘ 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. yes, that's a real sentence, and yes, it ate. πŸ’€

🌈 Superdaemon aware

Supports Server::Starter for hot deploy and graceful restarts. so iconic.

To use it, instead of the usual:

plackup --server Twiggy --port 8111 app.psgi

install Server::Starter and use:

start_server --port 8111 -- plackup --server Twiggy app.psgi

πŸ’œ ENVIRONMENT πŸ’œ

The following environment variables are supported. (yes, just the one, and she's doing her best πŸŽ€)

  • TWIGGY_DEBUG β€” set to true to enable debug messages from Twiggy. πŸ›βœ¨

πŸ“ LICENSE πŸ“

This module is licensed under the same terms as Perl itself. πŸ’… (iykyk)


🧚 AUTHOR 🧚

  • Tatsuhiko Miyagawa
  • Tokuhiro Matsuno
  • Yuval Kogman
  • Hideki Yamamura
  • Daisuke Maki

legends, all of them. πŸ‘‘


⭐ SEE ALSO ⭐

  • Plack
  • AnyEvent
  • Tatsumaki

okay that's the whole page bestie, go forth and serve some requests πŸ’–

this was brought to you by perl v5.32.0, dated 2021-01-24, and the Twiggy(3pm) era β€” mwah, bye!! πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from