NAME
Redis::hiredis - interact with Redis using the hiredis client.
SYNOPSIS
use Redis::hiredis;
my $redis = Redis::hiredis->new();
$redis->connect('127.0.0.1', 6379);
$redis->command([qw(set foo bar)]);
my $val = $redis->command([qw(get foo)]);
DESCRIPTION
Redis::hiredis
is a simple wrapper around Salvatore Sanfilippo's hiredis C client that allows connecting and sending any command just like you would from a command line Redis client.
METHODS
- new()
-
Creates a new Redis::hiredis object.
- connect( $hostname, $port )
-
$hostname
is the hostname of the Redis server to connect to$port
is the port to connect on. Default 6379 - command( $command )
-
$command
is an array ref of the command and parameters you would like to send to Redis ex:[qw( set foo bar )]
command will return a scalar value which will either be an integer, string or an array ref (if multiple values are returned).
SEE ALSO
The Redis command reference can be found here: http://code.google.com/p/redis/wiki/CommandReference
Documentation on the hiredis client can be found here: http://github.com/antirez/hiredis