line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::DBHResolver::Strategy::RoundRobin; |
2
|
2
|
|
|
2
|
|
1812
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
69
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
314
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub connect_info { |
7
|
0
|
|
|
0
|
0
|
|
my ($class, $resolver, $label, ) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
0
|
|
|
|
$resolver->config->{round_robin}->{$label} ||= $resolver->cluster($label); |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $node_label = shift @{$resolver->config->{round_robin}->{$label}}; |
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
push @{$resolver->config->{round_robin}->{$label}}, $node_label; |
|
0
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
$node_label; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__END__ |