24 Oct 2009 08:28:29 UTC
- Distribution: Plack-Server-Coro
- Module version: 0.02
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (2)
- Testers (67 / 95 / 12)
- KwaliteeBus factor: 1
- 35.50% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity24 month
- Download (41.46KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionMIYAGAWA Tatsuhiko Miyagawaand 1 contributors
- Tatsuhiko Miyagawa
Plack::Server::Coro - Coro cooperative multithread web server
plackup --server Coro
This is a Coro based Plack web server. It uses Net::Server::Coro under the hood, which means we have coroutines (threads) for each socket, active connections and a main loop.
Because it's Coro based your web application can actually block with I/O wait as long as it yields when being blocked, to the other coroutine either explicitly with
cedeor automatically (via Coro::* magic).
# your web application use Coro::LWP; my $content = LWP::Simple:;get($url); # this yields to other threads when IO blocks
The simple benchmark shows this server gives 2000 requests per second in the simple Hello World app, and 300 requests to serve 2MB photo files when used with AIO modules. Brilliantly fast.
This web server sets
psgi.multithreadenv var on.
This module is licensed under the same terms as Perl itself.
Module Install Instructions
To install Plack::Server::Coro, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Plack::Server::Coro
For more information on module installation, please visit the detailed CPAN module installation guide.