karlseguin / ccache

A golang LRU Cache for high concurrency
MIT License
1.27k stars 118 forks source link

Add TrackingSet method #48

Closed sargun closed 3 years ago

sargun commented 3 years ago

This method reduces the likelihood of a race condition where you can add a (tracked) item to the cache, and the item isn't the item you thought it was.

karlseguin commented 3 years ago

I added the corresponding function to LayeredCache: https://github.com/karlseguin/ccache/commit/0dbf3f125f135d89ecfa28bdc54c2230b9d1ab50

sargun commented 3 years ago

thank you. this is the fastest turn around I've seen from a maintainer.