diff options
author | Jay Hutchinson <jlhutch@gmail.com> | 2019-03-12 11:36:50 -0500 |
---|---|---|
committer | Jay Hutchinson <jlhutch@gmail.com> | 2019-03-12 11:36:50 -0500 |
commit | 3702264294061a3ebd6d3547566012dbbbdd0e6a (patch) | |
tree | 3d4e402f10ac522556de7d19494d011dd510e28f | |
parent | 5477065ce20416ef553ca5616b8c910cfe40d4bb (diff) | |
download | pylru-3702264294061a3ebd6d3547566012dbbbdd0e6a.tar.gz |
Added optional callback to FunctionCacheManager.
-rw-r--r-- | pylru.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |