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.131 by root, Fri Mar 9 19:07:53 2012 UTC vs.
Revision 1.132 by root, Sat Mar 10 20:34:11 2012 UTC

398 398
399=cut 399=cut
400 400
401sub rcv($@); 401sub rcv($@);
402 402
403sub _kilme { 403my $KILME = sub {
404 die "received message on port without callback"; 404 die "received message on port without callback";
405} 405};
406 406
407sub port(;&) { 407sub port(;&) {
408 my $id = $UNIQ . ++$ID; 408 my $id = $UNIQ . ++$ID;
409 my $port = "$NODE#$id"; 409 my $port = "$NODE#$id";
410 410
411 rcv $port, shift || \&_kilme; 411 rcv $port, shift || $KILME;
412 412
413 $port 413 $port
414} 414}
415 415
416=item rcv $local_port, $callback->(@msg) 416=item rcv $local_port, $callback->(@msg)
991or or is deleted the callback is called with a hash containing the 991or or is deleted the callback is called with a hash containing the
992database family and three lists of added, changed and deleted subkeys, 992database family and three lists of added, changed and deleted subkeys,
993respectively. If no keys have changed then the array reference might be 993respectively. If no keys have changed then the array reference might be
994C<undef> or even missing. 994C<undef> or even missing.
995 995
996If not called in void context, a guard object is returned that, when
997destroyed, stops the monitor.
998
996The family hash reference and the key arrays belong to AnyEvent::MP and 999The family hash reference and the key arrays belong to AnyEvent::MP and
997B<must not be modified or stored> by the callback. When in doubt, make a 1000B<must not be modified or stored> by the callback. When in doubt, make a
998copy. 1001copy.
999 1002
1000As soon as possible after the monitoring starts, the callback will be 1003As soon as possible after the monitoring starts, the callback will be

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines