--- AnyEvent-MP/MP.pm 2009/08/14 14:07:44 1.51 +++ AnyEvent-MP/MP.pm 2009/08/14 15:13:20 1.52 @@ -27,7 +27,7 @@ # creating/using ports, the simple way my $somple_port = port { my @msg = @_; 0 }; - # creating/using ports, type matching + # creating/using ports, tagged message matching my $port = port; rcv $port, ping => sub { snd $_[0], "pong"; 0 }; rcv $port, pong => sub { warn "pong received\n"; 0 }; @@ -145,14 +145,13 @@ =item $thisnode = NODE / $NODE -The C function returns, and the C<$NODE> variable contains -the noderef of the local node. The value is initialised by a call -to C or C, after which all local port -identifiers become invalid. +The C function returns, and the C<$NODE> variable contains the +noderef of the local node. The value is initialised by a call to +C. =item $noderef = node_of $port -Extracts and returns the noderef from a portid or a noderef. +Extracts and returns the noderef from a port ID or a noderef. =item initialise_node $noderef, $seednode, $seednode... @@ -281,11 +280,10 @@ =item snd $port, @msg Send the given message to the given port ID, which can identify either -a local or a remote port, and can be either a string or soemthignt hat -stringifies a sa port ID (such as a port object :). +a local or a remote port, and must be a port ID. While the message can be about anything, it is highly recommended to use a -string as first element (a portid, or some word that indicates a request +string as first element (a port ID, or some word that indicates a request type etc.). The message data effectively becomes read-only after a call to this