Redis::Cluster::Fast - A fast perl binding for Redis Cluster
use Redis::Cluster::Fast; my $redis = Redis::Cluster::Fast->new( startup_nodes => [ 'localhost:9000', 'localhost:9001', 'localhost:9002', 'localhost:9003', 'localhost:9004', 'localhost:9005', ], connect_timeout => 0.05, command_timeout => 0.05, max_retry => 10, ); $redis->set('test', 123); # '123' my $str = $redis->get('test'); $redis->mset('{my}foo', 'hoge', '{my}bar', 'fuga'); # get as array-ref my $array_ref = $redis->mget('{my}foo', '{my}bar'); # get as array my @array = $redis->mget('{my}foo', '{my}bar'); $redis->hset('mymap', 'field1', 'Hello'); $redis->hset('mymap', 'field2', 'ByeBye'); # get as hash-ref my $hash_ref = $redis->hgetall('mymap'); # get as hash my %hash = $redis->hgetall('mymap');
Redis::Cluster::Fast is like Redis::Fast but support Redis Cluster by hiredis-cluster.
Require Redis 6 or higher to support RESP3.
Following arguments are available.
Specifies the list of Redis Cluster nodes.
A fractional seconds. (default: 10)
Connection timeout to connect to a Redis node.
Redis Command execution timeout.
A integer value. (default: 10)
To run Redis command with arguments.
Copyright (C) plainbanana.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
plainbanana <plainbanana@mustardon.tokyo>
To install Redis::Cluster::Fast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Redis::Cluster::Fast
CPAN shell
perl -MCPAN -e shell install Redis::Cluster::Fast
For more information on module installation, please visit the detailed CPAN module installation guide.