Skip to content

Commit bc67052

Browse files
committed
"min_reconnect_interval" renamed to "reconnect_interval"
1 parent 5664cec commit bc67052

File tree

6 files changed

+55
-56
lines changed

6 files changed

+55
-56
lines changed

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AnyEvent-RipeRedis version 0.24
1+
AnyEvent-RipeRedis version 0.25_01
22
======================
33

44
INSTALLATION

examples/unix_socket.pl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
my $redis;
1212
$redis = AnyEvent::RipeRedis->new(
13-
host => 'unix/',
14-
port => '/var/run/redis/redis.sock',
15-
password => 'redis_pass',
16-
connection_timeout => 5,
17-
read_timeout => 5,
18-
min_reconnect_interval => 5,
13+
host => 'unix/',
14+
port => '/var/run/redis/redis.sock',
15+
password => 'redis_pass',
16+
connection_timeout => 5,
17+
read_timeout => 5,
18+
reconnect_interval => 5,
1919

2020
on_connect => sub {
2121
print "Connected to Redis server\n";

lib/AnyEvent/RipeRedis.pm

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use strict;
55
use warnings;
66
use base qw( Exporter );
77

8-
our $VERSION = '0.24';
8+
our $VERSION = '0.25_01';
99

1010
use AnyEvent::RipeRedis::Error;
1111

@@ -114,7 +114,7 @@ sub new {
114114

115115
$self->connection_timeout( $params{connection_timeout} );
116116
$self->read_timeout( $params{read_timeout} );
117-
$self->min_reconnect_interval( $params{min_reconnect_interval} );
117+
$self->reconnect_interval( $params{reconnect_interval} );
118118
$self->on_error( $params{on_error} );
119119

120120
$self->_reset_internals;
@@ -182,7 +182,7 @@ sub on_error {
182182
}
183183

184184
foreach my $name ( qw( connection_timeout read_timeout
185-
min_reconnect_interval ) )
185+
reconnect_interval ) )
186186
{
187187
*{$name} = sub {
188188
my $self = shift;
@@ -562,12 +562,12 @@ sub _execute {
562562
$self->_connect;
563563
}
564564
elsif ( $self->{reconnect} ) {
565-
if ( defined $self->{min_reconnect_interval}
566-
&& $self->{min_reconnect_interval} > 0 )
565+
if ( defined $self->{reconnect_interval}
566+
&& $self->{reconnect_interval} > 0 )
567567
{
568568
unless ( defined $self->{_reconnect_timer} ) {
569569
$self->{_reconnect_timer} = AE::timer(
570-
$self->{min_reconnect_interval}, 0,
570+
$self->{reconnect_interval}, 0,
571571
sub {
572572
undef $self->{_reconnect_timer};
573573
$self->_connect;
@@ -1065,14 +1065,14 @@ Requires Redis 1.2 or higher, and any supported event loop.
10651065
=head2 new( %params )
10661066
10671067
my $redis = AnyEvent::RipeRedis->new(
1068-
host => 'localhost',
1069-
port => 6379,
1070-
password => 'yourpass',
1071-
database => 7,
1072-
connection_timeout => 5,
1073-
read_timeout => 5,
1074-
lazy => 1,
1075-
min_reconnect_interval => 5,
1068+
host => 'localhost',
1069+
port => 6379,
1070+
password => 'yourpass',
1071+
database => 7,
1072+
connection_timeout => 5,
1073+
read_timeout => 5,
1074+
lazy => 1,
1075+
reconnect_interval => 5,
10761076
10771077
on_connect => sub {
10781078
# handling...
@@ -1161,12 +1161,12 @@ you need. Such behavior allows to control reconnection procedure.
11611161
11621162
Enabled by default.
11631163
1164-
=item min_reconnect_interval => $fractional_seconds
1164+
=item reconnect_interval => $fractional_seconds
11651165
1166-
If the parameter is specified, the client will try to reconnect not often, than
1167-
after this interval. Commands executed between reconnections will be queued.
1166+
If the parameter is specified, the client will try to reconnect only after
1167+
this interval. Commands executed between reconnections will be queued.
11681168
1169-
min_reconnect_interval => 5,
1169+
reconnect_interval => 5,
11701170
11711171
Not set by default.
11721172
@@ -1792,9 +1792,9 @@ Get or set the C<read_timeout> of the client.
17921792
17931793
Enables or disables reconnection mode of the client.
17941794
1795-
=head2 min_reconnect_interval( [ $fractional_seconds ] )
1795+
=head2 reconnect_interval( [ $fractional_seconds ] )
17961796
1797-
Get or set C<min_reconnect_interval> of the client.
1797+
Get or set C<reconnect_interval> of the client.
17981798
17991799
=head2 on_connect( [ $callback ] )
18001800

lib/AnyEvent/RipeRedis/Error.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use 5.008000;
44
use strict;
55
use warnings;
66

7-
our $VERSION = '0.24';
7+
our $VERSION = '0.25_01';
88

99
our %ERROR_CODES = (
1010
E_CANT_CONN => 1,

t/02-accessors.t

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ use AnyEvent::RipeRedis qw( :err_codes );
77
use AnyEvent::RipeRedis::Error;
88

99
my $redis = AnyEvent::RipeRedis->new(
10-
password => 'test',
11-
connection_timeout => 10,
12-
read_timeout => 5,
13-
reconnect => 1,
14-
min_reconnect_interval => 5,
15-
encoding => 'utf8',
10+
password => 'test',
11+
connection_timeout => 10,
12+
read_timeout => 5,
13+
reconnect => 1,
14+
reconnect_interval => 5,
1615

1716
on_connect => sub {
1817
return 1;
@@ -44,7 +43,7 @@ t_database($redis);
4443
t_conn_timeout($redis);
4544
t_read_timeout($redis);
4645
t_reconnect($redis);
47-
t_min_reconnect_interval($redis);
46+
t_reconnect_interval($redis);
4847
t_utf8($redis);
4948
t_on_connect($redis);
5049
t_on_disconnect($redis);
@@ -118,17 +117,17 @@ sub t_reconnect {
118117
return;
119118
}
120119

121-
sub t_min_reconnect_interval {
120+
sub t_reconnect_interval {
122121
my $redis = shift;
123122

124-
is( $redis->min_reconnect_interval, 5, q{get "min_reconnect_interval"} );
123+
is( $redis->reconnect_interval, 5, q{get "reconnect_interval"} );
125124

126-
$redis->min_reconnect_interval(undef);
127-
is( $redis->min_reconnect_interval, undef,
128-
q{disable "min_reconnect_interval"} );
125+
$redis->reconnect_interval(undef);
126+
is( $redis->reconnect_interval, undef,
127+
q{disable "reconnect_interval"} );
129128

130-
$redis->min_reconnect_interval(10);
131-
is( $redis->min_reconnect_interval, 10, q{set "min_reconnect_interval"} );
129+
$redis->reconnect_interval(10);
130+
is( $redis->reconnect_interval, 10, q{set "reconnect_interval"} );
132131

133132
return;
134133
}

t/10-exceptions.t

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use AnyEvent::RipeRedis;
88

99
t_conn_timeout();
1010
t_read_timeout();
11-
t_min_reconnect_interval();
11+
t_reconnect_interval();
1212
t_not_allowed_after_multi();
1313
t_on_message();
1414

@@ -97,43 +97,43 @@ sub t_read_timeout {
9797
return;
9898
}
9999

100-
sub t_min_reconnect_interval {
100+
sub t_reconnect_interval {
101101
like(
102102
exception {
103103
my $redis = AnyEvent::RipeRedis->new(
104-
min_reconnect_interval => 'invalid',
104+
reconnect_interval => 'invalid',
105105
);
106106
},
107-
qr/"min_reconnect_interval" must be a positive number/,
108-
q{invalid "min_reconnect_interval" (character string; constructor)},
107+
qr/"reconnect_interval" must be a positive number/,
108+
q{invalid "reconnect_interval" (character string; constructor)},
109109
);
110110

111111
like(
112112
exception {
113113
my $redis = AnyEvent::RipeRedis->new(
114-
min_reconnect_interval => -5,
114+
reconnect_interval => -5,
115115
);
116116
},
117-
qr/"min_reconnect_interval" must be a positive number/,
118-
q{invalid "min_reconnect_interval" (negative number; constructor)},
117+
qr/"reconnect_interval" must be a positive number/,
118+
q{invalid "reconnect_interval" (negative number; constructor)},
119119
);
120120

121121
my $redis = AnyEvent::RipeRedis->new();
122122

123123
like(
124124
exception {
125-
$redis->min_reconnect_interval('invalid');
125+
$redis->reconnect_interval('invalid');
126126
},
127-
qr/"min_reconnect_interval" must be a positive number/,
128-
q{invalid "min_reconnect_interval" (character string; accessor)},
127+
qr/"reconnect_interval" must be a positive number/,
128+
q{invalid "reconnect_interval" (character string; accessor)},
129129
);
130130

131131
like(
132132
exception {
133-
$redis->min_reconnect_interval(-5);
133+
$redis->reconnect_interval(-5);
134134
},
135-
qr/"min_reconnect_interval" must be a positive number/,
136-
q{invalid "min_reconnect_interval" (negative number; accessor)},
135+
qr/"reconnect_interval" must be a positive number/,
136+
q{invalid "reconnect_interval" (negative number; accessor)},
137137
);
138138

139139
return;

0 commit comments

Comments
 (0)