ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/68_poe_02_signals.t
Revision: 1.3
Committed: Thu Jul 9 22:49:18 2009 UTC (14 years, 11 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-4_82, rel-4_83
Changes since 1.2: +1 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 $|=1;
2     BEGIN {
3     print "1..5\n";
4     }
5    
6     use AnyEvent;
7 root 1.3 use AnyEvent::Impl::POE; $^W = 0;
8 root 1.1
9     print "ok 1\n";
10    
11     my $cv = AnyEvent->condvar;
12    
13     my $error = AnyEvent->timer (after => 5, cb => sub {
14     print <<EOF;
15     Bail out! No signal caught.
16     EOF
17     exit 0;
18     });
19    
20     my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
21     print "ok 3\n";
22     $cv->broadcast;
23     });
24    
25     print "ok 2\n";
26     kill 'INT', $$;
27     $cv->wait;
28     undef $error;
29    
30     print "ok 4\n";
31    
32     undef $sw;
33    
34     print "ok 5\n";
35