ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/eg/simple_example
Revision: 1.3
Committed: Sat Sep 5 21:16:59 2009 UTC (14 years, 8 months ago) by root
Branch: MAIN
CVS Tags: rel-2_02, rel-2_01, rel-1_23, rel-1_1, rel-1_2, rel-2_0, rel-1_28, rel-1_29, rel-1_24, rel-1_26, rel-1_27, rel-1_21, rel-1_22, rel-1_30, HEAD
Changes since 1.2: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

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