golang-lru icon indicating copy to clipboard operation
golang-lru copied to clipboard

onEvict callback for ARC

Open olebedev opened this issue 9 years ago • 8 comments

Hi, I would like to say thanks for this project guys.

Is there any plans to add onEvict callback to ARC cache too? Actually, it's pretty useful when you work with sync.Pool as well.

olebedev avatar Dec 22 '15 08:12 olebedev

+1 here

yonderblue avatar Nov 29 '16 01:11 yonderblue

Also +1 and if that possible onEvict for TwoQueueCache

vtolstov avatar Dec 21 '16 21:12 vtolstov

any news from devs? or package is drop down and not needed for hashicorp?

vtolstov avatar Dec 13 '17 08:12 vtolstov

I had a need for this same functionality and added support to it in https://github.com/bluele/gcache , FYI.

sean- avatar Dec 15 '17 22:12 sean-

Thanks, i'm switch package =)

vtolstov avatar Dec 16 '17 13:12 vtolstov

@sean- could have added it here instead :-)

jefferai avatar Dec 16 '17 14:12 jefferai

Heh. I started with this LRU implementation and moved to the other because it had some of the primitives I immediately needed.

https://github.com/joyent/pg_prefaulter/blob/master/agent/fhcache/cache.go#L61-L95

sean- avatar Dec 16 '17 22:12 sean-

I've added a draft PR for the evict functionality. #48

Feedback is welcome.

jasonsurratt avatar Aug 28 '18 15:08 jasonsurratt