asyncache icon indicating copy to clipboard operation
asyncache copied to clipboard

How to use lock

Open oxlade39 opened this issue 3 years ago • 4 comments

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:

# always use the key function for accessing cache items
with get_pep.cache_lock:
    get_pep.cache.pop(get_pep.cache_key(42), None)

However when using asyncache I don't appear to see any of the usual methods like cache_lock, cache_clear, cache_info etc?

How does one get access to those methods in the async wrapper?

ps. Thanks for the great library.

oxlade39 avatar Nov 06 '22 16:11 oxlade39

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! 😊

hephex avatar Nov 14 '22 16:11 hephex

Hi @hephex I'm missing the ability to call cache_clear from within the decorated method, is this planned to be added?

arossert avatar Jul 18 '23 17:07 arossert

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!

ivandigiusto avatar Oct 26 '23 03:10 ivandigiusto