Add a cache for get_current_state with state_key

This commit is contained in:
Mark Haines 2015-05-21 11:13:19 +01:00
parent e89ca34e0e
commit d61ce3f670
5 changed files with 46 additions and 2 deletions

View file

@ -124,6 +124,11 @@ class Cache(object):
self.sequence += 1
self.cache.pop(keyargs, None)
def invalidate_all(self):
self.check_thread()
self.sequence += 1
self.cache.clear()
def cached(max_entries=1000, num_args=1, lru=False):
""" A method decorator that applies a memoizing cache around the function.