Permalink
Browse files

add missing file

  • Loading branch information...
1 parent fc4dcc0 commit c3100ddc82e2bfa395197e69c794866b983f8d9a @kazuho committed Mar 28, 2010
Showing with 39 additions and 1 deletion.
  1. +3 −0 Changes
  2. +1 −1 lib/Starlet.pm
  3. +35 −0 t/02graceful.t
View
3 Changes
@@ -1,5 +1,8 @@
Revision history for Perl extension Starlet
+0.08
+ - [bugfix] delay termination (when receiving first SIGTERM or SIGINT) until all HTTP requests are being processed
+
0.07
- hardcode set $PSSPSS::VERSION
View
2 lib/Starlet.pm
@@ -2,7 +2,7 @@ package Starlet;
use 5.008_001;
-our $VERSION = '0.07';
+our $VERSION = '0.08';
1;
__END__
View
35 t/02graceful.t
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+
+use HTTP::Request::Common;
+use Plack::Test;
+use Test::More;
+
+$Plack::Test::Impl = 'Server';
+$ENV{PLACK_SERVER} = 'Starlet';
+
+warn $$;
+
+test_psgi
+ app => sub {
+ my $env = shift;
+ warn $$;
+ unless (my $pid = fork) {
+ die "fork failed:$!"
+ unless defined $pid;
+ # child process
+ sleep 1;
+ kill 'TERM', getppid();
+ exit 0;
+ }
+ sleep 5;
+ return [ 200, [ 'Content-Type' => 'text/plain' ], [ "hello world" ] ];
+ },
+ client => sub {
+ my $cb = shift;
+ warn $$;
+ my $res = $cb->(GET "/");
+ is $res->content, "hello world";
+ };
+
+done_testing;

0 comments on commit c3100dd

Please sign in to comment.