ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/eg/simple_example
Revision: 1.2
Committed: Fri Aug 28 21:22:12 2009 UTC (14 years, 9 months ago) by root
Branch: MAIN
CVS Tags: rel-0_95, rel-1_0, rel-0_9
Changes since 1.1: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.2 #!/opt/bin/perl
2 elmex 1.1 use AnyEvent;
3     use AnyEvent::MP;
4    
5     my $end_cv = AnyEvent->condvar;
6    
7     my $port = port;
8    
9     rcv $port, test => sub {
10     my ($data) = @_;
11     $end_cv->send ($data);
12     };
13    
14     snd $port, test => 123;
15    
16     print "Ending with: " . $end_cv->recv . "\n";