README.pod
April 8, 2015 · View on GitHub
=pod
=head1 NAME
AnyEvent::Hiredis - AnyEvent hiredis API
=head1 SYNOPSIS
use AnyEvent::Hiredis;
my $redis = AnyEvent::Hiredis->new( host => '127.0.0.1', port => 6379, );
redis->command( [qw/GET foo/], sub { my $value = shift } );
redis->command( [qw/LPOP listkey/], sub { my $value = shift } );
errors
redis->command( [qw/SOMETHING WRONG/, sub { my error = $_[1] } );
=head1 DESCRIPTION
CAnyEvent::Hiredis is an AnyEvent Redis API that uses the hiredis C client library (Lhttps://github.com/antirez/hiredis).
=head1 PERFORMANCE
One reason to consider CAnyEvent::Hiredis over its pure Perl counterpart CAnyEvent::Redis is performance. Here's a head to head comparison of the two modules running on general purpose hardware:
Rate ae_redis ae_hiredis
AnyEvent::Redis 7590/s -- -89%
AnyEvent::Hiredis 69400/s 814% --
Rate here is the number of set operations per second achieved by each module. See C<bin/compare.pl> for details.
=head1 METHODS
=head2 new
my $redis = AnyEvent::Hiredis->new; # 127.0.0.1:6379
my $redis = AnyEvent::Hiredis->new(server => '192.168.0.1', port => '6379');
=head2 command
C
key, 'foo'], sub { my (error) = @_;
$result; # 'OK'
});
key], sub { my (error) = @_;
$result; # 'foo'
});
If the Redis server replies with an error then C<error> will contain the Redis error string. Otherwise C<$error> will be
C
=head1 REPOSITORY
Lhttp://github.com/wjackson/anyevent-hiredis
=head1 AUTHORS
Whitney Jackson
Jonathan Rockway
=head1 SEE ALSO