NAME

Redis::Cluster::Fast - A fast perl binding for Redis Cluster

SYNOPSIS

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');

DESCRIPTION

Redis::Cluster::Fast is like Redis::Fast but support Redis Cluster by hiredis-cluster.

Require Redis 6 or higher to support RESP3.

METHODS

new(%args)

Following arguments are available.

startup_nodes

Specifies the list of Redis Cluster nodes.

connect_timeout

A fractional seconds. (default: 10)

Connection timeout to connect to a Redis node.

command_timeout

A fractional seconds. (default: 10)

Redis Command execution timeout.

max_retry

A integer value. (default: 10)

<command>(@args)

To run Redis command with arguments.

LICENSE

Copyright (C) plainbanana.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

plainbanana <plainbanana@mustardon.tokyo>

SEE ALSO

Redis::ClusterRider
Redis::Fast