Cory G Watson > CHI-Driver-Redis-0.04 > CHI::Driver::Redis

Download:
CHI-Driver-Redis-0.04.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
View/Report Bugs
Module Version: 0.04   Source  

NAME ^

CHI::Driver::Redis - Redis driver for CHI

SYNOPSIS ^

    use CHI;

    my $foo = CHI->new(
        driver => 'Redis',
        namespace => 'foo',
        server => '127.0.0.1:6379',
        debug => 0
    );

DESCRIPTION ^

A CHI driver that uses Redis to store the data. Care has been taken to not have this module fail in firey ways if the cache is unavailable. It is my hope that if it is failing and the cache is not required for your work, you can ignore it's warnings.

TECHNICAL DETAILS ^

Redis does not have namespaces. Therefore, we have to do some hoop-jumping.

Namespaces are tracked in a set named chinamespaces. This is a list of all the namespaces the driver has seen.

Keys in a namespace are stored in a set that shares the name of the namespace. The actual value is stored as "$namespace||key".

So, to illustrate. If you store a value foo: bar in namespace baz, Redis will contain something like the following:

CONSTRUCTOR OPTIONS ^

server and debug are passed to Redis.

ATTRIBUTES ^

redis

Contains the underlying Redis object.

AUTHOR ^

Cory G Watson, <gphat at cpan.org>

COPYRIGHT & LICENSE ^

Copyright 2009 Cold Hard Code, LLC.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: