The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Cache::Redis - Redis client specialized for cache

SYNOPSIS

use Cache::Redis;

my $cache = Cache::Redis->new(
    server    => 'localhost:9999',
    namespace => 'cache:',
);
$cache->set('key', 'val');
my $val = $cache->get('key');
$cache->remove('key');

DESCRIPTION

This module is for cache of Redis backend having Cache::Cache like interface.

THIS IS A DEVELOPMENT RELEASE. API MAY CHANGE WITHOUT NOTICE.

INTERFACE

Methods

my $obj = Cache::Redis->new(%options)

Create a new cache object. Various options may be set in %options, which affect the behaviour of the cache (defaults in parentheses):

$obj->set($key, $value, $expire)

Set a stuff to cache.

my $stuff = $obj->get($key)

Get a stuff from cache.

$obj->remove($key)

Remove stuff of key from cache.

$obj->get_or_set($key, $code, $expire)

Get a cache value for $key if it's already cached. If it's not cached then, run $code and cache $expiration seconds and return the value.

$obj->nowait_push

Wait all response from Redis. This is intended for $obj->nowait.

DEPENDENCIES

Perl 5.8.1 or later.

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

SEE ALSO

perl

AUTHOR

Masayuki Matsuki y.songmu@gmail.com

LICENSE AND COPYRIGHT

Copyright (c) 2013, Masayuki Matsuki. All rights reserved.

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