AnyEvent-Redis-RipeRedis
view release on metacpan or search on metacpan
133134135136137138139140141142143144145146147148149150151152153
is called in both cases:
when
operation was completed successfully and
when
some error occurred.
- Improved POD.
- Improved unit tests.
- Another wave of refactoring.
1.254 Mon Jun 9 17:44:55 MSK 2013
- Minor changes in POD.
1.253 Wed May 31 14:38:35 MSK 2013
- BUGFIX: Fixed premature triggering of the
'rtimeout'
timer in some cases.
1.252 Wed May 29 11:00:45 MSK 2013
- BUGFIX: Fixed reading from the uninitialized
read
buffer in some cases.
- Now, in tests empty TCP port is taken using module Net::EmptyPort.
1.251 Fri Apr 26 11:29:05 MSK 2013
- Slight modification of examples in POD
1.250 Thu Apr 25 22:00:30 MSK 2013
- Improved error handling
for
EXEC command and
for
Lua scripts, which returns
examples/subs.pl view on Meta::CPAN
81828384858687888990919293949596979899100101102103
"Unsubscribed: $pattern. Remaining: $channels_num\n"
;
if
(
$channels_num
== 0 ) {
$cv
->
send
();
}
},
}
);
my
$timer
;
$timer
= AE::timer( 5, 0,
sub
{
undef
(
$timer
);
exit
0;
# Emergency exit
},
);
};
my
$int_w
= AE::signal(
INT
=>
$on_signal
);
my
$term_w
= AE::signal(
TERM
=>
$on_signal
);
$cv
->
recv
();
examples/unix_socket.pl view on Meta::CPAN
192021222324252627282930313233343536373839
on_connect
=>
sub
{
"Connected to Redis server\n"
;
},
on_disconnect
=>
sub
{
"Disconnected from Redis server\n"
;
},
);
my
$timer
;
$timer
= AE::timer( 0, 1,
sub
{
$redis
->incr(
'foo'
,
sub
{
my
$data
=
shift
;
if
(
@_
) {
my
$err_msg
=
shift
;
warn
$err_msg
;
lib/AnyEvent/Redis/RipeRedis.pm view on Meta::CPAN
151152153154155156157158159160161162163164165166167168169170171
$self
->{_lazy_conn_st} =
$params
{lazy};
$self
->{_auth_st} = S_NEED_PERFORM;
$self
->{_select_db_st} = S_NEED_PERFORM;
$self
->{_ready_to_write} = 0;
$self
->{_input_queue} = [];
$self
->{_temp_queue} = [];
$self
->{_processing_queue} = [];
$self
->{_txn_lock} = 0;
$self
->{_channels} = {};
$self
->{_channel_cnt} = 0;
$self
->{_reconnect_timer} =
undef
;
unless
(
$self
->{_lazy_conn_st} ) {
$self
->_connect();
}
return
$self
;
}
sub
multi {
my
$self
=
shift
;
lib/AnyEvent/Redis/RipeRedis.pm view on Meta::CPAN
609610611612613614615616617618619620621622623624625626627628629630631632
}
}
elsif
(
$self
->{_lazy_conn_st} ) {
$self
->{_lazy_conn_st} = 0;
$self
->_connect();
}
elsif
(
$self
->{reconnect} ) {
if
(
defined
$self
->{min_reconnect_interval}
&&
$self
->{min_reconnect_interval} > 0 )
{
unless
(
defined
$self
->{_reconnect_timer} ) {
$self
->{_reconnect_timer} = AE::timer(
$self
->{min_reconnect_interval}, 0,
sub
{
undef
$self
->{_reconnect_timer};
$self
->_connect();
}
);
}
}
else
{
$self
->_connect();
}
}
else
{
t/07-lazy-conn.t view on Meta::CPAN
23242526272829303132333435363738394041424344454647
host
=>
$SERVER_INFO
->{host},
port
=>
$SERVER_INFO
->{port},
lazy
=> 1,
reconnect
=> 0,
on_connect
=>
sub
{
$T_IS_CONN
= 1;
},
);
my
$timer
;
$timer
= AnyEvent->timer(
after
=> 3,
cb
=>
sub
{
undef
$timer
;
ok( !
$T_IS_CONN
,
'lazy connection (no connected yet)'
);
$REDIS
->ping(
{
on_done
=>
sub
{
$cv
->
send
();
},
}
);
},
t/09-conn-errors.t view on Meta::CPAN
223224225226227228229230231232233234235236237238239240241242243244245246
$cv
->
send
();
},
on_error
=>
sub
{
$t_cli_err_msg
=
shift
;
$t_cli_err_code
=
shift
;
},
);
$redis
->ping(
{
on_done
=>
sub
{
my
$timer
;
$timer
= AE::postpone(
sub
{
undef
$timer
;
$server_info
->{server}->stop();
}
);
},
}
);
}
);
$server_info
= run_redis_instance(
t/test_helper.pl view on Meta::CPAN
313233343536373839404142434445464748495051
};
}
sub
ev_loop {
my
$sub
=
shift
;
my
$cv
= AE::cv();
$sub
->(
$cv
);
my
$timer
= AE::timer( 10, 0,
sub
{
diag(
'Emergency exit from event loop. Test failed'
);
$cv
->
send
();
}
);
$cv
->
recv
();
return
;
}
( run in 0.313 second using v1.01-cache-2.11-cpan-26ccb49234f )