ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP.pm
(Generate patch)

Comparing AnyEvent-MP/MP.pm (file contents):
Revision 1.72 by root, Mon Aug 31 10:07:04 2009 UTC vs.
Revision 1.73 by root, Mon Aug 31 11:08:25 2009 UTC

21 snd $port, type => data...; 21 snd $port, type => data...;
22 snd $port, @msg; 22 snd $port, @msg;
23 snd @msg_with_first_element_being_a_port; 23 snd @msg_with_first_element_being_a_port;
24 24
25 # creating/using ports, the simple way 25 # creating/using ports, the simple way
26 my $simple_port = port { my @msg = @_; 0 }; 26 my $simple_port = port { my @msg = @_ };
27 27
28 # creating/using ports, tagged message matching 28 # creating/using ports, tagged message matching
29 my $port = port; 29 my $port = port;
30 rcv $port, ping => sub { snd $_[0], "pong"; 0 }; 30 rcv $port, ping => sub { snd $_[0], "pong" };
31 rcv $port, pong => sub { warn "pong received\n"; 0 }; 31 rcv $port, pong => sub { warn "pong received\n" };
32 32
33 # create a port on another node 33 # create a port on another node
34 my $port = spawn $node, $initfunc, @initdata; 34 my $port = spawn $node, $initfunc, @initdata;
35 35
36 # monitoring 36 # monitoring

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines