Closed tanmaykm closed 3 years ago
@jcrist any concerns with this PR?
Thanks for putting this package up. I am planning to use this in a couple of my own packages. It will be nice to have this feature merged and a new version tagged.
@jcrist ping
Oop, sorry for the huge delay. This went to my old email, which I no longer use. Updated.
At first glance this looks fine. One passing thought is that at some point it might become necessary to have callbacks at other points. Perhaps one on entry to the cache as well. As such, it might be nice to have a more specific name. Perhaps on_exit
as the keyword argument?
Also, I no longer have the time/desire to maintain this project (no longer using Julia at work). If you're interested, I could give you contribute permissions and/or transfer the repo to somewhere else.
Hi jcrist - I am happy to contribute if you grant me permissions.
This can probably be closed now thanks to #23
It is often useful to have notifications when an item is being evicted from the cache to cleanup some state or release resources.
With this PR, LRU cache can be created with an optional callback function which will be called when an item is being evicted from the cache.
Example: