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.87 by root, Fri Sep 11 02:32:23 2009 UTC vs.
Revision 1.94 by root, Tue Sep 22 14:14:43 2009 UTC

1=head1 NAME 1=head1 NAME
2 2
3AnyEvent::MP - multi-processing/message-passing framework 3AnyEvent::MP - erlang-style multi-processing/message-passing framework
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use AnyEvent::MP; 7 use AnyEvent::MP;
8 8
31 31
32 # create a port on another node 32 # create a port on another node
33 my $port = spawn $node, $initfunc, @initdata; 33 my $port = spawn $node, $initfunc, @initdata;
34 34
35 # monitoring 35 # monitoring
36 mon $port, $cb->(@msg) # callback is invoked on death 36 mon $localport, $cb->(@msg) # callback is invoked on death
37 mon $port, $otherport # kill otherport on abnormal death 37 mon $localport, $otherport # kill otherport on abnormal death
38 mon $port, $otherport, @msg # send message on death 38 mon $localport, $otherport, @msg # send message on death
39 39
40=head1 CURRENT STATUS 40=head1 CURRENT STATUS
41 41
42 bin/aemp - stable. 42 bin/aemp - stable.
43 AnyEvent::MP - stable API, should work. 43 AnyEvent::MP - stable API, should work.
44 AnyEvent::MP::Intro - explains most concepts. 44 AnyEvent::MP::Intro - explains most concepts.
45 AnyEvent::MP::Kernel - mostly stable. 45 AnyEvent::MP::Kernel - mostly stable API.
46 AnyEvent::MP::Global - stable but incomplete, protocol not yet final. 46 AnyEvent::MP::Global - stable API.
47
48stay tuned.
49 47
50=head1 DESCRIPTION 48=head1 DESCRIPTION
51 49
52This module (-family) implements a simple message passing framework. 50This module (-family) implements a simple message passing framework.
53 51
150our $VERSION = $AnyEvent::MP::Kernel::VERSION; 148our $VERSION = $AnyEvent::MP::Kernel::VERSION;
151 149
152our @EXPORT = qw( 150our @EXPORT = qw(
153 NODE $NODE *SELF node_of after 151 NODE $NODE *SELF node_of after
154 configure 152 configure
155 snd rcv mon mon_guard kil reg psub spawn cal 153 snd rcv mon mon_guard kil psub spawn cal
156 port 154 port
157); 155);
158 156
159our $SELF; 157our $SELF;
160 158
567 } 565 }
568 566
569 $node->monitor ($port, $cb); 567 $node->monitor ($port, $cb);
570 568
571 defined wantarray 569 defined wantarray
572 and AnyEvent::Util::guard { $node->unmonitor ($port, $cb) } 570 and ($cb += 0, AnyEvent::Util::guard { $node->unmonitor ($port, $cb) })
573} 571}
574 572
575=item $guard = mon_guard $port, $ref, $ref... 573=item $guard = mon_guard $port, $ref, $ref...
576 574
577Monitors the given C<$port> and keeps the passed references. When the port 575Monitors the given C<$port> and keeps the passed references. When the port

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines