Open ouvaa opened 8 months ago
I've been thinking about this idea for a long time, but I haven't done it yet.
WithEvict
Option is provided, users may misunderstand/complain about why the item not being evicted when the TTL expires.WithListener
is a potential candidate.maybe I need to implement a simple/cheap evict policy in future, e.g. a random scan policy which similar with redis.
@phuslu chatgpt can help suggest some good names.
any progress?
It is easy to implement some scanner feature in/around a wrapper if some user really needs it, but to allow that, there has to be at least a callback when an item is evicted before expiration. So please add at least that callback, or give us some pointers on how it would be easiest to implement it.
possible to have an onevict call back feature for both the ttl and non ttl version?