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

Comparing AnyEvent-MP/MP/Global.pm (file contents):
Revision 1.62 by root, Fri Mar 23 21:16:25 2012 UTC vs.
Revision 1.63 by root, Fri Mar 23 21:25:04 2012 UTC

60our %NODE_REQ; 60our %NODE_REQ;
61 61
62# only in global code 62# only in global code
63our %GLOBAL_MON; # monitors {family} 63our %GLOBAL_MON; # monitors {family}
64 64
65sub other_globals() {
66 grep $_ ne $NODE && node_is_up $_, keys %{ $GLOBAL_DB{"'g"} }
67}
68
69# broadcasts a message to all other global nodes 65# broadcasts a message to all other global nodes
70sub g_broadcast { 66sub g_broadcast {
71 snd $_, @_ 67 snd $_, @_
72 for other_globals; 68 for grep $_ ne $NODE && node_is_up $_, keys %{ $GLOBAL_DB{"'g"} }
73} 69}
74 70
75# add/replace/del inside a family in the database 71# add/replace/del inside a family in the database
76# @$dle must not contain any key in %$set 72# @$dle must not contain any key in %$set
77sub g_upd { 73sub g_upd {
219# switch to global mode 215# switch to global mode
220 216
221# regularly try to connect to global nodes - maybe use seeding code? 217# regularly try to connect to global nodes - maybe use seeding code?
222$MASTER_TIMER = AE::timer 0, $AnyEvent::MP::Kernel::CONFIG->{monitor_timeout}, sub { 218$MASTER_TIMER = AE::timer 0, $AnyEvent::MP::Kernel::CONFIG->{monitor_timeout}, sub {
223 (add_node $_)->connect 219 (add_node $_)->connect
224 for other_globals; 220 for keys %{ $GLOBAL_DB{"'g"} }
225}; 221};
226 222
227# instantly connect to other global nodes when we learn of them 223# instantly connect to other global nodes when we learn of them
228# so we don't have to wait for the timer. 224# so we don't have to wait for the timer.
229#TODO 225#TODO

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines