Cache::Memcached::Indexable - A key indexable Cache::Memcached wrapper


NAME

Cache::Memcached::Indexable - A key indexable Cache::Memcached wrapper


SYNOPSIS

 use Cache::Memcached::Indexable;
 
 $memd = new Cache::Memcached::Indexable {
     'servers' => [ "10.0.0.15:11211", "10.0.0.15:11212",
                    "10.0.0.17:11211", [ "10.0.0.17:11211", 3 ] ],
     'debug' => 0,
     'compress_threshold' => 10_000,
 };
 $memd->set_servers($array_ref);
 $memd->set_compress_threshold(10_000);
 $memd->enable_compress(0);
 
 $memd->set("my_key", "Some value");
 $memd->set("object_key", { 'complex' => [ "object", 2, 4 ]});
 
 $val = $memd->get("my_key");
 $val = $memd->get("object_key");
 if ($val) { print $val->{'complex'}->[2]; }
 
 $memd->incr("key");
 $memd->decr("key");
 $memd->incr("key", 2);
 
 @all_keys = $memd->keys;


DESCRIPTION

THIS IS ALPHA SOFTWARE

Cache::Memcached::Indexable is a key indexable memcached interface. It is a simple wrapper class of the Cache::Memcached manpage. Usually, we can't get any key information of stored data with using memcached. This module provides keys() method (likes CORE::keys()) for getting all of stored key information.

In fact, this module uses only a few patterns of knowable key, and it stores the key with the value of large hash-ref. It controls the large hash-ref when you call set, get or delete methods.

It was implantated some functions of Cache::Memcached. But the implanted functions are only documented functions. Note that some undocumented functions weren't implanted to this module.


CONSTRUCTOR

new

Takes one parameter, a hashref of options. Almost same as the Cache::Memcached manpage's constructor. But it has some additional parameter.


METHODS

keys()

You can get all of stored keys with calling this method.

And the usage of following methods. See the Cache::Memcached manpage document.

set_servers
set_debug
set_readonly
set_norehash
set_compress_threshold
enable_compress
get
get_multi
set
add
replace
delete
incr
decr
stats
disconnect_all
flush_all


WARRANTY

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.


AUTHOR

Koichi Taniguchi <taniguchi@livedoor.jp>


LICENSE

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


SEE ALSO

the Cache::Memcached manpage, the Cache::Memcached::Indexable::Logic manpage, the Cache::Memcached::Indexable::Logic::Default manpage