ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/07_feeder.t
Revision: 1.2
Committed: Mon Oct 23 14:49:51 2006 UTC (17 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.1: +4 -4 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.2 $grp->feed_limit (5);
18     $grp->feed (sub {
19 root 1.1 return if $cn2 >= 10;
20     $cn2++;
21 root 1.2 (add $grp IO::AIO::aio_sleep 0)->cb (sub {
22 root 1.1 $cn3++;
23 root 1.2 });
24 root 1.1 });
25    
26     print $cn2 == 5 ? "" : "not ", "ok 2\n";
27     print $cn3 == 0 ? "" : "not ", "ok 3\n";
28    
29     IO::AIO::poll while IO::AIO::nreqs;
30    
31     print $cn2 == 10 ? "" : "not ", "ok 5\n";
32     print $cn3 == 10 ? "" : "not ", "ok 6\n";
33