--- cvsroot/AnyEvent-MP/MP.pm 2009/09/07 18:33:44 1.81 +++ cvsroot/AnyEvent-MP/MP.pm 2009/09/07 18:42:09 1.82 @@ -623,7 +623,9 @@ exists or it runs out of package names. The init function is then called with the newly-created port as context -object (C<$SELF>) and the C<@initdata> values as arguments. +object (C<$SELF>) and the C<@initdata> values as arguments. It I +call one of the C functions to set callbacks on C<$SELF>, otherwise +the port might not get created. A common idiom is to pass a local port, immediately monitor the spawned port, and in the remote init function, immediately monitor the passed @@ -657,6 +659,7 @@ my $port = shift; my $init = shift; + # rcv will create the actual port local $SELF = "$NODE#$port"; eval { &{ load_func $init }