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.79 by root, Fri Sep 4 21:52:09 2009 UTC vs.
Revision 1.80 by root, Fri Sep 4 22:30:29 2009 UTC

628A common idiom is to pass a local port, immediately monitor the spawned 628A common idiom is to pass a local port, immediately monitor the spawned
629port, and in the remote init function, immediately monitor the passed 629port, and in the remote init function, immediately monitor the passed
630local port. This two-way monitoring ensures that both ports get cleaned up 630local port. This two-way monitoring ensures that both ports get cleaned up
631when there is a problem. 631when there is a problem.
632 632
633C<spawn> guarantees that the C<$initfunc> has no visible effects on the
634caller before C<spawn> returns (by delaying invocation when spawn is
635called for the local node).
636
633Example: spawn a chat server port on C<$othernode>. 637Example: spawn a chat server port on C<$othernode>.
634 638
635 # this node, executed from within a port context: 639 # this node, executed from within a port context:
636 my $server = spawn $othernode, "MyApp::Chat::Server::connect", $SELF; 640 my $server = spawn $othernode, "MyApp::Chat::Server::connect", $SELF;
637 mon $server; 641 mon $server;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines