21 Jan 2021 07:01:30 UTC
- Distribution: Twiggy
- Module version: 0.1026
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (1176 / 20 / 0)
- KwaliteeBus factor: 1
- 48.50% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity24 month
- Download (59.98KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:11 non-PAUSE usersMIYAGAWA Tatsuhiko Miyagawa
Twiggy - AnyEvent HTTP server for PSGI
twiggy --listen :8080
twiggy -hfor more details.
use Twiggy::Server; my $server = Twiggy::Server->new( host => $host, port => $port, ); $server->register_service($app); AE::cv->recv;
Twiggy is a lightweight and fast HTTP server with unique features such as:
Can run any PSGI applications. Fully supports psgi.nonblocking and psgi.streaming interfaces.
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).
This software used to be called Plack::Server::AnyEvent but was renamed to Twiggy.
- Fast header parser
- 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.
- Superdaemon aware
Supports Server::Starter for hot deploy and graceful restarts.
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
The following environment variables are supported.
Set to true to enable debug messages from Twiggy.
This module is licensed under the same terms as Perl itself.