The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

NAME

MooseX::WithCache::Backend::Cache::Memcached - Cache::Memcached Backend

SYNOPSIS

package MyObject;
with_cache(
backend => 'Cache::Memcached'
);
package main;
my $obj = MyObject->new(
cache => Cache::Memcached->new({ ... });
);
$obj->cache_get($key);
$obj->cache_set($key);
$obj->cache_del($key);
$obj->cache_incr($key);
$obj->cache_decr($key);
# In list context: returns the list of gotten results
my @list = $obj->cache_get_multi(@keys);
# In scalar context: returns a hashref with cached results,
# and missing keys
my $h = $obj->cache_get_multi(@keys);
# {
# results => {
# key1 => $cache_hit_value1,
# key2 => $cache_hit_value2,
# ...
# },
# missing => [ 'key3', 'key4', 'key5' .... ]
# }

METHODS

build_cache_decr_method

build_cache_del_method

build_cache_get_method

build_cache_get_multi_method

build_cache_incr_method

build_cache_set_method

install_cache_attr