=head1 NAME AnyEvent::RipeRedis - Flexible non-blocking Redis client =head1 SYNOPSIS use AnyEvent; use AnyEvent::RipeRedis; my $redis = AnyEvent::RipeRedis->new( host => 'localhost', port => 6379, password => 'yourpass', ); my $cv = AE::cv; $redis->set( 'foo', 'bar', sub { my $err = $_[1]; if ( defined $err ) { warn $err->message . "\n"; $cv->send; return; } $redis->get( 'foo', sub { my $reply = shift; my $err = shift; if ( defined $err ) { warn $err->message . "\n"; $cv->send; return; } print "$reply\n"; $cv->send; } ); } ); $cv->recv; =head1 DESCRIPTION AnyEvent::RipeRedis is flexible non-blocking Redis client. Supports subscriptions, transactions and can automaticaly restore connection after failure. Requires Redis 1.2 or higher, and any supported event loop. =head1 CONSTRUCTOR =head2 new( %params ) my $redis = AnyEvent::RipeRedis->new( host => 'localhost', port => 6379, password => 'yourpass', database => 7, connection_timeout => 5, read_timeout => 5, lazy => 1, reconnect_interval => 5, on_connect => sub { # handling... }, on_disconnect => sub { # handling... }, on_error => sub { my $err = shift; # error handling... }, ); =over =item host => $host Server hostname (default: 127.0.0.1) =item port => $port Server port (default: 6379) =item password => $password If the password is specified, the C command is sent to the server after connection. =item database => $index Database index. If the index is specified, the client switches to the specified database after connection. You can also switch to another database after connection by using C