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::CacheSizer -- component object for managing the size of caches

Author

       Original author: DeWitt Clinton <dewitt@unto.net>

       Last author:     $Author: dclinton $

       Copyright (C) 2001-2003 DeWitt Clinton

perl v5.34.0                                       2022-06-30                             Cache::CacheSizer(3pm)

Description

       The CacheSizer class is used internally in SizeAware caches such as SizeAwareFileCache to encapsulate the
       logic of limiting cache size.

Methods

new($cache,$max_size)
           Construct a new Cache::CacheSizer object for the cache $cache with a maximum size of $max_size.

       update_access_time($key)
           Inform the cache that the object specified by $key has been accessed.

       limit_size($new_size)
           Use the sizing algorithms to get the cache down under $new_size if possible.

Name

       Cache::CacheSizer -- component object for managing the size of caches

Properties

get_max_size
           The desired size limit for the cache under control.

See Also

       Cache::Cache, Cache::CacheMetaData, Cache::SizeAwareCache

Synopsis

         use Cache::CacheSizer;

         my $sizer = new Cache::CacheSizer( $cache, $max_size );

         $sizer->limit_size( $new_size );

See Also