Are there plans to implement namespace operations fully into CHI? When
I think of being able to work with namespaces in a cache, I think of
doing the following:
my $cache = CHI->new(%opts);
$cache->add_namespace("objects_by_primary_key");
# Do some stuff...
$cache->add_namespace("primary_keys_by_unique_keys");
#Do some stuff...
$cache->set_namespace("objects_by_primary_key"); #Makes all further
cache methods operate on the objects_by_primary_key namespace only
$cache->clear; #Clears only objects in the objects_by_primary_key namespace
Currently, many of the drivers don't support this type of namespace
operations, so you'd have to write some wrapper functions that kept
track of which objects were on which namespace.
Just wanting to get a feel if this was one of the goals of CHI or not.
The benefit here is that I can specify one large cache, and let the LRU
algorithm figure out what stays cached and what doesn't. I don't have
to mess with separate cache objects.
I'm trying to write a CHI module for Rose::DB::Object and these features
would make a lot of sense. I can work around them, but it would be nice
to see them in CHI.