--- AnyEvent-MP/MP.pm 2009/09/11 02:32:23 1.87 +++ AnyEvent-MP/MP.pm 2009/09/22 14:13:33 1.92 @@ -1,6 +1,6 @@ =head1 NAME -AnyEvent::MP - multi-processing/message-passing framework +AnyEvent::MP - erlang-style multi-processing/message-passing framework =head1 SYNOPSIS @@ -33,19 +33,17 @@ my $port = spawn $node, $initfunc, @initdata; # monitoring - mon $port, $cb->(@msg) # callback is invoked on death - mon $port, $otherport # kill otherport on abnormal death - mon $port, $otherport, @msg # send message on death + mon $localport, $cb->(@msg) # callback is invoked on death + mon $localport, $otherport # kill otherport on abnormal death + mon $localport, $otherport, @msg # send message on death =head1 CURRENT STATUS bin/aemp - stable. AnyEvent::MP - stable API, should work. AnyEvent::MP::Intro - explains most concepts. - AnyEvent::MP::Kernel - mostly stable. - AnyEvent::MP::Global - stable but incomplete, protocol not yet final. - -stay tuned. + AnyEvent::MP::Kernel - mostly stable API. + AnyEvent::MP::Global - stable API. =head1 DESCRIPTION @@ -152,7 +150,7 @@ our @EXPORT = qw( NODE $NODE *SELF node_of after configure - snd rcv mon mon_guard kil reg psub spawn cal + snd rcv mon mon_guard kil psub spawn cal port ); @@ -568,6 +566,8 @@ $node->monitor ($port, $cb); + $cb += 0; + defined wantarray and AnyEvent::Util::guard { $node->unmonitor ($port, $cb) } }