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.112 by root, Tue Oct 2 13:58:07 2012 UTC vs.
Revision 1.113 by root, Tue Jun 28 11:38:24 2016 UTC

503 ; 503 ;
504} 504}
505 505
506sub seed_all { 506sub seed_all {
507 my @seeds = grep 507 my @seeds = grep
508 !exists $SEED_CONNECT{$_}
509 && !(defined $SEED_NODE{$_} && node_is_up $SEED_NODE{$_}), 508 !(defined $SEED_NODE{$_} && node_is_up $SEED_NODE{$_}),
510 keys %SEED_NODE; 509 keys %SEED_NODE;
511 510
512 if (@seeds) { 511 if (@seeds) {
513 # start connection attempt for every seed we are not connected to yet 512 # start connection attempt for every seed we are not connected to yet
514 seed_connect $_ 513 seed_connect $_
515 for @seeds; 514 for grep !exists $SEED_CONNECT{$_}, @seeds;
516 515
517 $SEED_RETRY = $SEED_RETRY * 2; 516 $SEED_RETRY = $SEED_RETRY * 2;
518 $SEED_RETRY = $AnyEvent::MP::Kernel::CONFIG->{monitor_timeout} 517 $SEED_RETRY = $AnyEvent::MP::Kernel::CONFIG->{monitor_timeout}
519 if $SEED_RETRY > $AnyEvent::MP::Kernel::CONFIG->{monitor_timeout}; 518 if $SEED_RETRY > $AnyEvent::MP::Kernel::CONFIG->{monitor_timeout};
520 519
526 } 525 }
527} 526}
528 527
529sub seed_again { 528sub seed_again {
530 $SEED_RETRY = (1 + rand) * 0.6; 529 $SEED_RETRY = (1 + rand) * 0.6;
531 $SEED_WATCHER ||= AE::timer $SEED_RETRY, 0, \&seed_all; 530 $SEED_WATCHER ||= AE::timer 0, 0, \&seed_all;
532} 531}
533 532
534# sets new seed list, starts connecting 533# sets new seed list, starts connecting
535sub set_seeds(@) { 534sub set_seeds(@) {
536 %SEED_NODE = (); 535 %SEED_NODE = ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines