… | |
… | |
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 | |
50 | This value is called with an error or warning message, when e.g. a |
50 | This 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 | |
444 | Returns true iff the given node is currently known to the system. |
444 | Returns true iff the given node is currently known to the system. The only |
|
|
445 | time a node is known but not up currently is when a conenction request is |
|
|
446 | pending. |
445 | |
447 | |
446 | =cut |
448 | =cut |
447 | |
449 | |
448 | sub node_is_known($) { |
450 | sub node_is_known($) { |
449 | exists $NODE{$_[0]} |
451 | exists $NODE{$_[0]} |
… | |
… | |
500 | |
502 | |
501 | Callbacks I<must not> block and I<should not> send any messages. |
503 | Callbacks I<must not> block and I<should not> send any messages. |
502 | |
504 | |
503 | The function returns an optional guard which can be used to unregister |
505 | The function returns an optional guard which can be used to unregister |
504 | the monitoring callback again. |
506 | the monitoring callback again. |
|
|
507 | |
|
|
508 | Example: make sure you call function C<newnode> for all nodes that are up |
|
|
509 | or go up (and down). |
|
|
510 | |
|
|
511 | newnode $_, 1 for up_nodes; |
|
|
512 | mon_nodes \&newnode; |
505 | |
513 | |
506 | =cut |
514 | =cut |
507 | |
515 | |
508 | our %MON_NODES; |
516 | our %MON_NODES; |
509 | |
517 | |