ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/t/08_async.t
Revision: 1.2
Committed: Sat Feb 9 23:05:18 2008 UTC (16 years, 4 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-3_2, rel-3_1
Changes since 1.1: +54 -23 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.2 BEGIN { $| = 1; print "1..12\n"; }
2 root 1.1
3     no warnings;
4     use strict;
5    
6     use EV;
7    
8 root 1.2 {
9     my ($a1, $a2, $a3);
10 root 1.1
11 root 1.2 $a3 = EV::async sub {
12     print "not ok 1\n";
13     };
14     $a2 = EV::async sub {
15     print "ok 4\n";
16     $a1->cb (sub {
17     print "ok 5\n";
18     EV::unloop;
19     });
20     $a1->send;
21     };
22     $a1 = EV::async sub {
23     print "ok 3\n";
24     $a2->send;
25     };
26    
27     print "ok 1\n";
28     $a1->send;
29     $a1->send;
30     $a1->send;
31     print "ok 2\n";
32     EV::loop;
33     print "ok 6\n";
34     }
35    
36     {
37     my $l = new EV::Loop;
38     my ($a1, $a2, $a3);
39    
40     $a3 = $l->async (sub {
41     print "not ok 7\n";
42 root 1.1 });
43 root 1.2 $a2 = $l->async (sub {
44     print "ok 10\n";
45     $a1->cb (sub {
46     print "ok 11\n";
47     $l->unloop;
48     });
49     $a1->send;
50     });
51     $a1 = $l->async (sub {
52     print "ok 9\n";
53     $a2->send;
54     });
55    
56     print "ok 7\n";
57     $a1->send;
58     $a1->send;
59 root 1.1 $a1->send;
60 root 1.2 print "ok 8\n";
61     $l->loop;
62     print "ok 12\n";
63     }