Home | Trees | Indices | Help |
|
---|
|
object --+ | CacheAbstract
Abstract class for cache implementations. Main function just provides referenced api documentation. Use CacheInRam or CacheOnDisk instead which are derived from this class. Note: Michele says: there are signatures inside gdbm files that are used directly by the python gdbm adapter that often are lagging behind in the detection code in python part. On every occasion that a gdbm store is probed by the python adapter, the probe fails, because gdbm file version is newer. Using gdbm directly from C would work, because there is backward compatibility, but not from python! The .shelve file is discarded and a new one created (with new signature) and it works until it is probed again... The possible consequences are memory leaks and broken sessions.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
cache_stats_name =
|
|
|||
Inherited from |
|
Tries to retrieve the value corresponding to `key` from the cache if the object exists and if it did not expire, else it calls the function `f` and stores the output in the cache corresponding to `key`. It always returns the function that is returned. Args: key(str): the key of the object to be stored or retrieved f(function): the function whose output is to be cached. If `f` is `None` the cache is cleared. time_expire(int): expiration of the cache in seconds. It's used to compare the current time with the time when the requested object was last saved in cache. It does not affect future requests. Setting `time_expire` to 0 or negative value forces the cache to refresh. |
Initializes the object Args: request: the global request object
|
Clears the cache of all keys that match the provided regular expression. If no regular expression is provided, it clears all entries in cache. Args: regex: if provided, only keys matching the regex will be cleared, otherwise all keys are cleared. |
Increments the cached value for the given key by the amount in value Args: key(str): key for the cached object to be incremeneted value(int): amount of the increment (defaults to 1, can be negative) |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 16 02:36:11 2014 | http://epydoc.sourceforge.net |