ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/06_group.t
Revision: 1.5
Committed: Mon Oct 23 20:05:27 2006 UTC (17 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.4: +2 -0 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 root 1.4 print "1..12\n";
6 root 1.1
7 root 1.5 IO::AIO::min_parallel 2;#d#
8    
9 root 1.2 my $grp = aio_group sub {
10 root 1.3 print $_[0] == 1 && @_ == 3 ? "" : "not ", "ok 4\n";
11 root 1.1 };
12    
13 root 1.3 $grp->result (1,2,3);
14    
15 root 1.1 my ($a, $b) =
16     add $grp (aio_stat "/2", sub { print "ok 3\n" }),
17     (aio_stat "/3", sub { print "not ok 3\n" });
18    
19     print "ok 1\n";
20    
21     $b->cancel;
22    
23     print "ok 2\n";
24    
25     IO::AIO::poll while IO::AIO::nreqs;
26    
27     print "ok 5\n";
28    
29 root 1.2 $grp = aio_group sub {
30 root 1.3 print @_ == 0 ? "" : "not ", "ok 6\n";
31 root 1.1 };
32    
33 root 1.3 $grp->result (4,5,6);
34     $grp->result;
35    
36 root 1.1 add $grp aio_stat "/1", sub { print "not ok 7\n" };
37    
38     $grp->cancel;
39    
40     print "ok 6\n";
41    
42     IO::AIO::poll while IO::AIO::nreqs;
43    
44 root 1.2 aio_group sub {
45 root 1.1 print "ok 8\n";
46     };
47    
48     print "ok 7\n";
49    
50     IO::AIO::poll while IO::AIO::nreqs;
51    
52     IO::AIO::aio_sleep 0, sub { print "ok 9\n" };
53    
54     IO::AIO::poll while IO::AIO::nreqs;
55    
56     print "ok 10\n";
57 root 1.4
58     aio_nop sub {
59     print "ok 11\n";
60     };
61    
62     IO::AIO::poll while IO::AIO::nreqs;
63    
64     print "ok 12\n";