Closed CMCDragonkai closed 11 years ago
It looks like the feature described in #27 is what you are looking for.
Right now, passive delete (which is the default) doesn't delete the item right when it expires. The expired item is still in the cache. But if you request the expired item, it is immediately deleted. The feature described in #27 is the ability to specify a callback that will be executed when the item expires. The expired item will be passed as an argument to that callback. In that callback you could do the following:
Does that seem like it would work for you?
In the second example, is the done() function the same as the callback passed into the get's third parameter? Yes it could work, but it does require some manual programming. Would prefer it if you had a soft get function, that would allow the ability to get the item without deleting it.
K, I'll work something out.
How about three levels:
That sounds great.
I have a situation, where I don't want the cache to immediately delete items that have expired. This is because I need to check if I can update the old item with a request to a third party service, if that third party service rejects my request, I need access to the old cached item and have the option to reset the expiry.
Any ideas on how to achieve that? I see that both passive and aggressive delete both deletes the item when it has been invalidated.