ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/eg/simple_example_receiver
Revision: 1.1
Committed: Fri Aug 28 14:43:53 2009 UTC (14 years, 9 months ago) by elmex
Branch: MAIN
Log Message:
more work on the intro.

File Contents

# User Rev Content
1 elmex 1.1 #!/opt/perl/bin/perl
2     use AnyEvent;
3     use AnyEvent::MP;
4     use AnyEvent::MP::Global;
5    
6     initialise_node "eg_simple_receiver";
7    
8     my $port = port;
9    
10     AnyEvent::MP::Global::register $port, "eg_receivers";
11    
12     rcv $port, test => sub {
13     my ($data, $reply_port) = @_;
14    
15     print "Received data: " . $data . "\n";
16     };
17    
18     AnyEvent->condvar->recv;