Add `noself=True` parameter (equivalent to "aiocache" package)
See original GitHub issueSource code for aiocache.decorators
:param noself: bool if you are decorating a class function, by default self is also used to
generate the key. This will result in same function calls done by different class instances
to use different cache keys. Use noself=True if you want to ignore it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Caches — aiocache 0.11.1 documentation
Clears the cache in the cache namespace. If an alternative namespace is given, it will clear those ones instead. Parameters: namespace – str...
Read more >aio-libs/aiocache: Asyncio cache manager for redis ... - GitHub
This library aims for simplicity over specialization. All caches contain the same minimum interface which consists on the following functions: add : Only...
Read more >How to use the aiocache.cached function in aiocache - Snyk
To help you get started, we've selected a few aiocache.cached examples, based on popular ways it is used in public projects.
Read more >Aiocache @cached decorator doesn't return the result
Finally I've found solution: I used always same parameter, so I should use key_builder without key parameter due to generate different keys ...
Read more >aiocache 0.3.2 - PyPI
The operations supported by all backends are: add. get. set. multi_get. multi_set. delete ... Install the package with pip install aiocache. simple redis....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@AIGeneratedUsername So I remade the decorator that @unmade suggested and we will have the next solution
I described this in the documentation, can you take a look on it in the MR ? As you see my english not so well - so any comments are welcome
I did research and I found an issue why this parameter was added to aiocache - aio-libs/aiocache#129 - nothing special, I mean that the there are no reason why method that need to be cached use self , but self is not used in value that will be in cache - it should be static or class method.
I have no doubt that it is useful for existing code, so I suggest that we can add workaround that @unmade made and put it to the documentation. We will have: