Permalink
Browse files

follow changes up to Plack 0.9920, prepare 0.04

  • Loading branch information...
1 parent 1a1209f commit f27e9109ef23d36dcb02b0c2241bb4a01f53ae58 @kazuho committed Mar 25, 2010
Showing with 38 additions and 13 deletions.
  1. +8 −1 Changes
  2. +4 −1 MANIFEST.SKIP
  3. +3 −3 Makefile.PL
  4. +9 −3 lib/Plack/Server/Standalone/Prefork/Server/Starter.pm
  5. +14 −5 t/00base.t
View
9 Changes
@@ -1,4 +1,11 @@
Revision history for Perl extension Plack::Server::Standalone::Prefork::Server::Starter
-0.02 Fri Jan 1 14:39:00 JST 2010
+0.04
+ - follow the changes up to Plack 0.9920
+
+0.03
+ - try to find start_server from $PATH and $^X, or skip most tests (but not all) if not found
+ - require 5.008, recommend HTTP::Parser::XS
+
+0.02
- require Parallel::Prefork (since Plack intentionally does not require P::Prefork required by Standalone::Prefork)
View
5 MANIFEST.SKIP
@@ -17,5 +17,8 @@
^[^/]+\.yaml$
^[^/]+\.pl$
^\.shipit$
-\.git
+\.git$
+\.git/
nytprof/
+\.rej$
+\.orig$
View
6 Makefile.PL
@@ -3,10 +3,10 @@ use inc::Module::Install;
all_from 'lib/Plack/Server/Standalone/Prefork/Server/Starter.pm';
readme_from 'lib/Plack/Server/Standalone/Prefork/Server/Starter.pm';
-requires 'Plack' => 0.9020;
-requires 'Parallel::Prefork' => 0.05; # since Plack does not intentionally requires P::Prefork required by Standalone::Prefork
+requires 'Plack' => 0.9920;
+requires 'Parallel::Prefork' => 0.07;
-requires 'Server::Starter' => 0.05;
+requires 'Server::Starter' => 0.06;
test_requires 'Test::More' => 0.88;
test_requires 'Test::TCP' => 0.15;
View
12 lib/Plack/Server/Standalone/Prefork/Server/Starter.pm
@@ -4,9 +4,9 @@ use strict;
use warnings;
use Server::Starter ();
-use base qw(Plack::Server::Standalone::Prefork);
+use base qw(HTTP::Server::PSGI);
-our $VERSION = '0.02';
+our $VERSION = '0.04';
sub new {
my ($klass, %args) = @_;
@@ -19,6 +19,8 @@ sub new {
$args{port} = $hostport;
}
+ $args{max_workers} ||= 10;
+
my $self = $klass->SUPER::new(%args);
$self->{listen_sock} = IO::Socket::INET->new(
@@ -51,9 +53,13 @@ All parameters of L<Plack::Server::Standalone::Prefork> except "host" and "port"
Kazuho Oku
+=head1 NOTES
+
+If you are looking for a standalone preforking HTTP server, then you should really look at L<Starman>. However if your all want is a simple HTTP server that runs behind a reverse proxy, this good old module still does what it used to.
+
=head1 SEE ALSO
-L<Plack::Server::Standalone::Prefork>
+L<Starman>
L<Server::Starter>
=head1 LICENSE
View
19 t/00base.t
@@ -2,6 +2,7 @@ use strict;
use warnings;
use File::Basename ();
+use List::Util qw(first);
use LWP::Simple ();
use Test::TCP ();
@@ -11,10 +12,16 @@ BEGIN {
use_ok('Server::Starter');
};
-my ($start_server) = grep { -x $_ } map { "$_/start_server" } (
- File::Basename::dirname($^X),
- split /:/, $ENV{PATH},
-);
+sub findprog {
+ my $prog = shift;
+ first { -x $_ } map { "$_/$prog" } (
+ File::Basename::dirname($^X),
+ split /:/, $ENV{PATH},
+ );
+}
+
+my $start_server = findprog('start_server');
+my $plackup = findprog('plackup');
if ($start_server) {
my $port = Test::TCP::empty_port();
@@ -26,7 +33,9 @@ if ($start_server) {
exec(
$start_server,
"--port=$port",
- qw(-- plackup -s Standalone::Prefork::Server::Starter t/00base-hello.psgi),
+ "--",
+ $plackup,
+ qw(--server Standalone::Prefork::Server::Starter t/00base-hello.psgi),
);
die "failed to launch server using start_server:$!";
}

0 comments on commit f27e910

Please sign in to comment.