hephex / asyncache

Helpers to use cachetools with async functions
MIT License
90 stars 12 forks source link

Would adding support for @cachemethod be welcome? #5

Closed chrisglass closed 1 year ago

chrisglass commented 2 years ago

I find myself using cachetools and async code more and more, and had to write my own fork of cachetool to get the behavior I need in my project ( see https://github.com/tkem/cachetools/pull/234 )

As pointed out, asyncache works great with cachetools, which I'd like to use instead of my own fork. One functionality that we rely on however is cachetool's @cachedmethod decorator (essentially, grabbing the cache instance from the decorated method's class instead of a global cache).

Would a PR adding a @cachedmethod decorator be welcome? Plus tests, obviously. If it would, I am happy to work on it (most of the code already exists on my drive).

Thanks in any case!

hephex commented 1 year ago

@chrisglass sorry for the late reply. Yes it would great if you could open a PR with your solution! 😄

hephex commented 1 year ago

this is now available in 0.3.0