1 |
#!/usr/bin/perl |
2 |
|
3 |
use IO::AIO; |
4 |
|
5 |
print "1..10\n"; |
6 |
|
7 |
my $grp = aio_group sub { |
8 |
print "ok 4\n"; |
9 |
}; |
10 |
|
11 |
my ($a, $b) = |
12 |
add $grp (aio_stat "/2", sub { print "ok 3\n" }), |
13 |
(aio_stat "/3", sub { print "not ok 3\n" }); |
14 |
|
15 |
print "ok 1\n"; |
16 |
|
17 |
$b->cancel; |
18 |
|
19 |
print "ok 2\n"; |
20 |
|
21 |
IO::AIO::poll while IO::AIO::nreqs; |
22 |
|
23 |
print "ok 5\n"; |
24 |
|
25 |
$grp = aio_group sub { |
26 |
print "not ok 6\n"; |
27 |
}; |
28 |
|
29 |
add $grp aio_stat "/1", sub { print "not ok 7\n" }; |
30 |
|
31 |
$grp->cancel; |
32 |
|
33 |
print "ok 6\n"; |
34 |
|
35 |
IO::AIO::poll while IO::AIO::nreqs; |
36 |
|
37 |
aio_group sub { |
38 |
print "ok 8\n"; |
39 |
}; |
40 |
|
41 |
print "ok 7\n"; |
42 |
|
43 |
IO::AIO::poll while IO::AIO::nreqs; |
44 |
|
45 |
IO::AIO::aio_sleep 0, sub { print "ok 9\n" }; |
46 |
|
47 |
IO::AIO::poll while IO::AIO::nreqs; |
48 |
|
49 |
print "ok 10\n"; |
50 |
|