Replies: 1 comment
-
Having a callback like that is a good idea, however, I'm not yet sure if it should be allowed to block the cache's execution since this would affect other operations like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would a need to set a callback that will be called when an item is about to expire in order to allow external code to decide whether the item expires or remains for another TTL cycle.
My use-case is straightforward: At TTL expiration, if the value still exists in the database, then leave the corresponding item in the cache. Otherwise evict it
Prior art:
https://pkg.go.dev/github.com/ReneKroon/ttlcache/v2#Cache.SetCheckExpirationCallback
1 vote ·
Beta Was this translation helpful? Give feedback.
All reactions