summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Hutchinson <jlhutch@gmail.com>2019-03-12 11:36:50 -0500
committerJay Hutchinson <jlhutch@gmail.com>2019-03-12 11:36:50 -0500
commit3702264294061a3ebd6d3547566012dbbbdd0e6a (patch)
tree3d4e402f10ac522556de7d19494d011dd510e28f
parent5477065ce20416ef553ca5616b8c910cfe40d4bb (diff)
downloadpylru-3702264294061a3ebd6d3547566012dbbbdd0e6a.tar.gz
Added optional callback to FunctionCacheManager.
-rw-r--r--pylru.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pylru.py b/pylru.py
index b3c321a..c751e37 100644
--- a/pylru.py
+++ b/pylru.py
@@ -2,7 +2,7 @@
# Cache implementaion with a Least Recently Used (LRU) replacement policy and
# a basic dictionary interface.
-# Copyright (C) 2006-2018 Jay Hutchinson
+# Copyright (C) 2006-2019 Jay Hutchinson
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@@ -524,9 +524,9 @@ class WriteBackCacheManager(object):
class FunctionCacheManager(object):
- def __init__(self, func, size):
+ def __init__(self, func, size, callback=None):
self.func = func
- self.cache = lrucache(size)
+ self.cache = lrucache(size, callback)
def size(self, size=None):
return self.cache.size(size)