CHI
view release on metacpan or search on metacpan
lib/CHI/Driver/CacheCache.pm view on Meta::CPAN
use Carp;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use Module::Runtime qw(require_module);
use strict;
use warnings;
extends 'CHI::Driver::Base::CacheContainer';
has 'cc_class' => ( is => 'ro', isa => Str, required => 1 );
has 'cc_options' => ( is => 'ro', isa => HashRef, required => 1 );
sub BUILD {
my ( $self, $params ) = @_;
$self->{_contained_cache} = $self->_build_contained_cache;
}
sub _build_contained_cache {
my ($self) = @_;
lib/CHI/Driver/Memory.pm view on Meta::CPAN
use CHI::Constants qw(CHI_Meta_Namespace);
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use strict;
use warnings;
extends 'CHI::Driver';
our %Global_Datastore = (); ## no critic (ProhibitPackageVars)
has 'datastore' => ( is => 'ro', isa => HashRef );
has 'global' => ( is => 'ro', isa => Bool );
sub default_discard_policy { 'lru' }
# We see a lot of repeated '$self->{datastore}->{$self->{namespace}}'
# expressions below. The reason this cannot be easily memoized in the object
# is that we want the cache to be cleared across multiple existing CHI
# objects when the datastore itself is emptied - e.g. %datastore = ()
#
( run in 0.716 second using v1.01-cache-2.11-cpan-5f2e87ce722 )