GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CACHE::AGAINSTFILE::BASE (3)

.ds Aq ’

NAME

Cache::AgainstFile::Base - base class for default backends

CONTENTS

SYNOPSIS



 package Cache::AgainstFile::MyBackend;

 use Cache::AgainstFile::Base;
 @ISA = qw(Cache::AgainstFile::Base);

 ...implement methods...

 1;



DESCRIPTION

This provides a default implementation for purging the cache, based on a list of stale files and a hashref of access times.

Classes inheriting from this base class should provide the following public methods:
$b = new Cache::AgainstFile::MyBackend(\&loader, \%options) This should call the base class constructor.
$data = $b->get($filename, @opts) Fetch an item from the cache. @opts should be passed after the filename to the loader coderef.
$n = $b->count() Number of items in the cache
$bytes = $b->size() Total size of the cache in bytes
They should also provide the following protected methods which are used to support purge():
$b->_remove(\@filenames) Remove a number of items from the cache
$hashref = $b->_accessed() A hashref of filename => access time
@filenames = $b->_stale() A list of cache items which are stale with respect to their original files

OPTIONS

The implementation of purge() supports the options:
NoStat
MaxItems
MaxATime

VERSION

$Revision: 1.8 $ on $Date: 2005/06/03 14:29:55 $ by $Author: johna $

AUTHOR

John Alden <cpan _at_ bbc _dot_ co _dot_ uk>

COPYRIGHT

(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL.

See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CACHE::AGAINSTFILE::BASE (3) 2006-05-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.