File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ subtest batch => sub {
7171 set_pipes => 1
7272 );
7373 $c -> start();
74- is $c -> last-> getline, " Hello world 3\n " ;
7574 $c -> wait_stop();
75+ is $c -> last-> getline, " Hello world 3\n " ;
7676
7777 my $result ;
7878 $c -> add(code => sub { return 40 + 2 }, separate_err => 0, set_pipes => 0);
Original file line number Diff line number Diff line change 1+ # !/usr/bin/perl
2+
3+ use Mojo::Base -strict;
4+ use Test::More;
5+ use Time::HiRes qw( sleep) ;
6+ use FindBin;
7+ use lib (" $FindBin::Bin /lib" , " ../lib" , " lib" );
8+ use Mojo::IOLoop::ReadWriteProcess qw( process batch) ;
9+ use Data::Dumper;
10+
11+ my $sleepduration = 0;
12+
13+ subtest " Signal on IO" => sub {
14+ my @stack ;
15+
16+ my $p1 = process(sub { sleep 2; print " Hello world\n " });
17+ for my $i (1 .. 10) {
18+ push (@stack , process(sub { sleep 0.2 * $i ; print " Bye Bye" }))
19+ }
20+ my $c = batch @stack ;
21+
22+ $p1 -> start;
23+ $c -> start();
24+ is ($p1 -> getline(), " Hello world\n " , " P1 can read with signals received!" );
25+ is (!!$! {EINTR }, 1, " EINTR is set" );
26+ };
27+
28+ done_testing;
You can’t perform that action at this time.
0 commit comments