ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/07_feeder.t
Revision: 1.4
Committed: Tue Oct 24 11:57:30 2006 UTC (17 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-2_3, rel-2_0, rel-2_6, rel-2_4, rel-2_5, rel-2_2, rel-2_61, rel-2_51, rel-2_32, rel-2_33, rel-2_31, rel-2_62, rel-2_1, rel-2_41, rel-2_21
Changes since 1.3: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.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 root 1.3 limit $grp 5;
18 root 1.2 $grp->feed (sub {
19 root 1.1 return if $cn2 >= 10;
20     $cn2++;
21 root 1.3 aioreq_pri $cn2;
22 root 1.4 (add $grp IO::AIO::aio_busy 0)->cb (sub {
23 root 1.1 $cn3++;
24 root 1.2 });
25 root 1.1 });
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