goburrow / cache

Mango Cache 🥭 - Partial implementation of Guava Cache in Go (golang).
BSD 3-Clause "New" or "Revised" License
574 stars 48 forks source link

Feature Request: Expire After Write #6

Closed AdityaVivek closed 4 years ago

AdityaVivek commented 7 years ago

The cache seems to only have a feature to expire entries that are not accessed. What about expiring entries after a time limit? (Or is there is already a way to do this which I've missed?)

nqv commented 7 years ago

Yeah, it's not implemented yet. May be you can use WithRefreshAfterWrite with a LoadingCache

AdityaVivek commented 7 years ago

Thanks. I was using LoadingCache before this, but I wasn't sure what "refresh" meant in this context. I assume it means the entry will have its value cleared?

nqv commented 4 years ago

Hi, this is fixed in https://github.com/goburrow/cache/commit/4060fe738647abf6f1adbece2cd69c7fecb3e942 Would you please check out that version?