NAME

Tie::Redis::Candy - Tie Redis to HashRef or ArrayRef

VERSION

version 1.001

SYNOPSIS

use Tie::Redis::Candy qw(redis_hash redis_array);

my $redis = Redis->new(...);

my $hashref = redis_hash($redis, $key, %initial_values);
$hashref->{foo} = 'bar';

my $arrayref = redis_array($redis, $listname, @initial_values);
push @$arrayref => ('foo', 'bar');

DESCRIPTION

This module is inspired by Tie::Redis and Redis::Hash/Redis::List.

FUNCTIONS

redis_hash ($redis, $key, %initial_values);

$redis must be an instance of Redis. $key is the name of the hash key.

The hash will not cleared at this point, but the initial values are appended.

redis_array ($redis, $listname, @initial_values);

Behaves similiar to "redis_hash", except that a redis array is used.

The array will not cleared at this point, but the initial values are pushed at the end of list.

SERIALIZATION

Serialization is done by CBOR::XS which is fast and light.

EXPORTS

Nothing by default. "redis_hash" and "redis_array" can be exported on request.

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/zurborg/libtie-redis-candy-perl/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

David Zurborg <zurborg@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by David Zurborg.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)