PAB3::HashmapCache - Caches hashmaps used in PAB3
use PAB3; use PAB3::HashmapCache; $pab = PAB3->new( 'hashmap_cache' => PAB3::HashmapCache->new(), );
PAB3::HashmapCache provides an interface to cache hashes that maps to arrays. One time it is added to the PAB3 class, it will be used by it automatically.
Creates a new class of PAB3::HashmapCache and loads the hashmap cache from file if it exists.
posible arguments are:
path_cache => path to folder where cache can be saved default value is "/tmp" cache_file => the name of the cache file default value is the crc32 of calling filename plus '.hashmap.cache'
$hmc = PAB3::HashmapCache->new( 'path_cache' => '/path/to/cache', 'cache_file' => 'hashmap.cache', ); $pab = PAB3->new( 'hashmap_cache' => $hmc, );
See also PAB3->add_hashmap
Write the hashmap cache to disk.
save() is called internally when the class gets destroyed or inside ModPerl as cleanup callback at the end of each request. If you use PAB3::CGI, it will be registered as callback by PAB3::CGI::cleanup_register. In other environments, like PerlEx or FastCGI, that do not support cleanup mechanism you need to call it by yourself.
Christian Mueller <christian_at_hbr1.com>
The PAB3::HashmapCache module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.