--- AnyEvent-MP/MP.pm 2009/08/01 07:36:30 1.4 +++ AnyEvent-MP/MP.pm 2009/08/01 10:02:33 1.6 @@ -29,6 +29,10 @@ Despite its simplicity, you can securely message other processes running on the same or other hosts. +At the moment, this module family is severly brokena nd underdocumented, +so do not use. This was uploaded mainly to resreve the CPAN namespace - +stay tuned! + =head1 CONCEPTS =over 4 @@ -54,7 +58,7 @@ (connected to a master node only). Only when they epxlicitly "become public" can you send them messages from unrelated other nodes. -=item noderef - C, C +=item noderef - C, C, C A noderef is a string that either uniquely identifies a given node (for private and hidden nodes), or contains a recipe on how to reach a given @@ -83,7 +87,7 @@ use base "Exporter"; -our $VERSION = '0.0'; +our $VERSION = '0.01'; our @EXPORT = qw(NODE $NODE $PORT snd rcv _any_); our $DEFAULT_SECRET; @@ -113,6 +117,7 @@ =cut our $UNIQ = sprintf "%x.%x", $$, time; # per-process/node unique cookie +our $ID = "a0"; our $PUBLIC = 0; our $NODE; our $PORT; @@ -368,7 +373,10 @@ =head1 NODE MESSAGES -Nodes understand the following messages sent to them: +Nodes understand the following messages sent to them. Many of them take +arguments called C<@reply>, which will simply be used to compose a reply +message - C<$reply[0]> is the port to reply to, C<$reply[1]> the type and +the remaining arguments are simply the message data. =over 4 @@ -402,7 +410,11 @@ =item eval => $string[ @reply] Evaluates the given string. If C<@reply> is given, then a message of the -form C<@reply, $@, @evalres> is sent (C<$reply[0]> is the port to reply to). +form C<@reply, $@, @evalres> is sent. + +Example: crash another node. + + snd $othernode, eval => "exit"; =cut @@ -416,6 +428,12 @@ Replies the the current node time to C<@reply>. +Example: tell the current node to send the current time to C<$myport> in a +C message. + + snd $NODE, time => $myport, timereply => 1, 2; + # => snd $myport, timereply => 1, 2,