Open oxlade39 opened 1 year ago
It's not currently possible, but it's on my todo list. I upgraded the library recently to support the new version, but I postponed this change (I should have made it clear in the changelog 😓 ).
I might be able to get it done in the next few days because it should be pretty straightforward.
ps. Thanks for the great library.
Thank you! 😊
Hi @hephex I'm missing the ability to call cache_clear
from within the decorated method, is this planned to be added?
Hi @hephex, Really appreciate making async cachetools available to the public.
Any chance to get the new cache methods (cache clear, info, lock, ...) available in asyncache?
Thanks!
Just for reference, to have simple access to the cache, lock, etc all that is needed is to add:
https://github.com/hephex/asyncache/blob/master/asyncache/__init__.py#L110
def cache_clear():
cache.clear()
wrapper.cache = cache
wrapper.cache_key = key
wrapper.cache_lock = lock
wrapper.cache_clear = cache_clear
return functools.wraps(func)(wrapper)
Of course, it's a bit simplistic but it does the work.
How is one supposed to safely evict entries?
I'm going off of the
cachetools
documentation here and thought that to clear the cache I would need to do something like documentation in this place, eg:However when using
asyncache
I don't appear to see any of the usual methods likecache_lock
,cache_clear
,cache_info
etc?How does one get access to those methods in the async wrapper?
ps. Thanks for the great library.