logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Cache::Memory - Memory based implementation of the Cache interface

Author

        Chris Leishman <chris@leishman.org>
        Based on work by DeWitt Clinton <dewitt@unto.net>

Constructor

         my $cache = Cache::Memory->new( %options )

       The constructor takes cache properties as named arguments, for example:

         my $cache = Cache::Memory->new( namespace => 'MyNamespace',
                                         default_expires => '600 sec' );

       See 'PROPERTIES' below and in the Cache documentation for a list of all available properties that can be
       set.

Description

       The Cache::Memory class implements the Cache interface.  This cache stores data on a per-process basis.
       This is the fastest of the cache implementations, but is memory intensive and data can not be shared
       between processes.  It also does not persist after the process dies.  However data will remain in the
       cache until cleared or it expires.  The data will be shared between instances of the cache object, a
       cache object going out of scope will not destroy the data.

Methods

       See 'Cache' for the API documentation.

Name

       Cache::Memory - Memory based implementation of the Cache interface

Properties

       Cache::Memory adds the property 'namespace', which allows you to specify a different caching store area
       to use from the default.  All methods will work ONLY on the namespace specified.

        my $ns = $c->namespace();
        $c->set_namespace( $namespace );

       For additional properties, see the 'Cache' documentation.

See Also

       Cache

Synopsis

         use Cache::Memory;

         my $cache = Cache::Memory->new( namespace => 'MyNamespace',
                                         default_expires => '600 sec' );

       See Cache for the usage synopsis.

See Also