Package Ganga :: Package Utility :: Module Caching :: Class FunctionCache
[hide private]
[frames] | no frames]

Class FunctionCache

source code

object --+    
         |    
     Cache --+
             |
            FunctionCache

Instance Methods [hide private]
 
__init__(self, function, dset, max_size=10)
Builds a cache with a limit of max_size entries.
source code
 
__call__(self, *args, **kw) source code
 
check(self, key, name, entry)
Override this method to check whether the entry with the given name is stale.
source code
 
build(self, key, name, opened, entry)
Build the cached value with the given name from the given opened resource.
source code

Inherited from Cache: __delitem__, __getitem__, __setitem__, clear, commit, key, lru, mru

Inherited from Cache (private): _access, _checkitem, _checklru, _get_entry, _pack, _unpack

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from Cache: cacheDict

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, function, dset, max_size=10)
(Constructor)

source code 

Builds a cache with a limit of max_size entries. If this limit is exceeded, the Least Recently Used entry is discarded. if max_size==0, the cache is unbounded (no LRU rule is applied).

Overrides: object.__init__
(inherited documentation)

check(self, key, name, entry)

source code 

Override this method to check whether the entry with the given name is stale. Return None if it is fresh or an opened resource if it is stale. The object returned will be passed to the 'build' method as the 'opened' parameter. Use the 'entry' parameter to store meta-data if required. Don't worry about multiple threads accessing the same name, as this method is properly isolated.

Overrides: Cache.check
(inherited documentation)

build(self, key, name, opened, entry)

source code 

Build the cached value with the given name from the given opened resource. Use entry to obtain or store meta-data if needed. Don't worry about multiple threads accessing the same name, as this method is properly isolated.

Overrides: Cache.build
(inherited documentation)