ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/07_feeder.t
Revision: 1.3
Committed: Tue Oct 24 03:17:40 2006 UTC (17 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.2: +2 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/usr/bin/perl
2
3 use IO::AIO;
4
5 print "1..6\n";
6
7 my $grp = aio_group sub {
8 print "ok 4\n";#d#
9 };
10
11 my $cn1 = 10;
12 my $cn2 = 0;
13 my $cn3 = 0;
14
15 print "ok 1\n";
16
17 limit $grp 5;
18 $grp->feed (sub {
19 return if $cn2 >= 10;
20 $cn2++;
21 aioreq_pri $cn2;
22 (add $grp IO::AIO::aio_sleep 0)->cb (sub {
23 $cn3++;
24 });
25 });
26
27 print $cn2 == 5 ? "" : "not ", "ok 2\n";
28 print $cn3 == 0 ? "" : "not ", "ok 3\n";
29
30 IO::AIO::poll while IO::AIO::nreqs;
31
32 print $cn2 == 10 ? "" : "not ", "ok 5\n";
33 print $cn3 == 10 ? "" : "not ", "ok 6\n";
34