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.38 by root, Fri Aug 7 22:55:18 2009 UTC vs.
Revision 1.39 by root, Fri Aug 7 23:21:48 2009 UTC

619 619
620The port ID of the newly created port is return immediately, and it is 620The port ID of the newly created port is return immediately, and it is
621permissible to immediately start sending messages or monitor the port. 621permissible to immediately start sending messages or monitor the port.
622 622
623After the port has been created, the init function is 623After the port has been created, the init function is
624called. This fucntion must be a fully-qualified function name 624called. This function must be a fully-qualified function name
625(e.g. C<MyApp::Chat::Server::init>). 625(e.g. C<MyApp::Chat::Server::init>).
626 626
627If the function doesn't exist, then the node tries to C<require> 627If the function doesn't exist, then the node tries to C<require>
628the package, then the package above the package and so on (e.g. 628the package, then the package above the package and so on (e.g.
629C<MyApp::Chat::Server>, C<MyApp::Chat>, C<MyApp>) until the function 629C<MyApp::Chat::Server>, C<MyApp::Chat>, C<MyApp>) until the function
669sub spawn(@) { 669sub spawn(@) {
670 my ($noderef, undef) = split /#/, shift, 2; 670 my ($noderef, undef) = split /#/, shift, 2;
671 671
672 my $id = "$RUNIQ." . $ID++; 672 my $id = "$RUNIQ." . $ID++;
673 673
674 $_[0] =~ /::/
675 or Carp::croak "spawn init function must be a fully-qualified name, caught";
676
674 ($NODE{$noderef} || add_node $noderef) 677 ($NODE{$noderef} || add_node $noderef)
675 ->send (["", "AnyEvent::MP::_spawn" => $id, @_]); 678 ->send (["", "AnyEvent::MP::_spawn" => $id, @_]);
676 679
677 "$noderef#$id" 680 "$noderef#$id"
678} 681}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines