-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial caching - better caching control #145
Comments
Sorry for the delay... I usually tell people that the decorators are there to make simple use cases easy. If you want to do something more complicated, it's probably better to use the |
So I think what I hear you saying is:
I think if I were to do this, I'd end up with another decorator (let's call it cache2) that probably has an additional field within because I really need control over how the code decides to cache and the current I'm not really opposed to doing the work for this. I already have the need, and I was going to do just that (I've already started that route). I guess I opened this github request up in more of a question as to whether or not you were interested in a Pull Request to update cachetools. I think the feedback here indicates that you'd rather not add more complexity to the current library. I'm cool with that. Thanks! |
@brianbruggeman Sorry for the late response - you're right, with my limited time at hand, I'd rather not add too much options to the library, especially the decorators. |
I think this may be similar, but possibly more generic to the exception handling issue (#138). I'd really like a way of controlling the caching within the cached code.
The basic idea would be to have the current decorator immediately slurp the cache key and set a flag for that key which could be disabled within the cached code base. At the end of the execution, the
cached
decorator would check to see if the flag is still set and then cache the results. If the flag is not set, then it wouldn't cache the results.And sort of a follow-on is that I'd like a way of ultimately resetting or dropping the cache based on an external to the cached code decision. I suspect I could come up with a hack for that by simply re-initializing the cache, but I think I'd prefer it to be a method(s) on the cache itself.
The text was updated successfully, but these errors were encountered: