ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP/Kernel.pm
(Generate patch)

Comparing AnyEvent-MP/MP/Kernel.pm (file contents):
Revision 1.45 by root, Mon Sep 7 12:04:32 2009 UTC vs.
Revision 1.46 by root, Mon Sep 7 20:00:38 2009 UTC

40 %NODE %PORT %PORT_DATA $UNIQ $RUNIQ $ID 40 %NODE %PORT %PORT_DATA $UNIQ $RUNIQ $ID
41 add_node load_func snd_to_func snd_on eval_on 41 add_node load_func snd_to_func snd_on eval_on
42 42
43 NODE $NODE node_of snd kil port_is_local 43 NODE $NODE node_of snd kil port_is_local
44 configure 44 configure
45 known_nodes up_nodes mon_nodes node_is_known node_is_up 45 up_nodes mon_nodes node_is_up
46); 46);
47 47
48=item $AnyEvent::MP::Kernel::WARN->($level, $msg) 48=item $AnyEvent::MP::Kernel::WARN->($level, $msg)
49 49
50This value is called with an error or warning message, when e.g. a 50This value is called with an error or warning message, when e.g. a
439############################################################################# 439#############################################################################
440# node monitoring and info 440# node monitoring and info
441 441
442=item node_is_known $nodeid 442=item node_is_known $nodeid
443 443
444Returns true iff the given node is currently known to the system. 444Returns true iff the given node is currently known to the system. The only
445time a node is known but not up currently is when a conenction request is
446pending.
445 447
446=cut 448=cut
447 449
448sub node_is_known($) { 450sub node_is_known($) {
449 exists $NODE{$_[0]} 451 exists $NODE{$_[0]}
500 502
501Callbacks I<must not> block and I<should not> send any messages. 503Callbacks I<must not> block and I<should not> send any messages.
502 504
503The function returns an optional guard which can be used to unregister 505The function returns an optional guard which can be used to unregister
504the monitoring callback again. 506the monitoring callback again.
507
508Example: make sure you call function C<newnode> for all nodes that are up
509or go up (and down).
510
511 newnode $_, 1 for up_nodes;
512 mon_nodes \&newnode;
505 513
506=cut 514=cut
507 515
508our %MON_NODES; 516our %MON_NODES;
509 517

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines