repoze.lru
API¶
Module: repoze.lru
¶
LRU caching class and decorator
-
class
repoze.lru.
LRUCache
(size)[source]¶ Implements a pseudo-LRU algorithm (CLOCK)
The Clock algorithm is not kept strictly to improve performance, e.g. to allow get() and invalidate() to work without acquiring the lock.
-
class
repoze.lru.
ExpiringLRUCache
(size, default_timeout=1152921504606846976)[source]¶ Implements a pseudo-LRU algorithm (CLOCK) with expiration times
The Clock algorithm is not kept strictly to improve performance, e.g. to allow get() and invalidate() to work without acquiring the lock.
-
class
repoze.lru.
lru_cache
(maxsize, cache=None, timeout=None, ignore_unhashable_args=False)[source]¶ Decorator for LRU-cached function
timeout parameter specifies after how many seconds a cached entry should be considered invalid.
-
class
repoze.lru.
CacheMaker
(maxsize=None, timeout=1152921504606846976)[source]¶ Generates decorators that can be cleared later