Comments (4)
I think this must work. I ususally used in this way.
my_redis_cache = ring.redis(redis_connection, coder='pickle')
@my_redis_cache
def item_interaction_trends(self, start_date: date = None, end_date: date = None) -> dict:
pass
Please let me know if you meet any problem to do this.
from ring.
@youknowone
this will do for sure. it's more of an issue if I want some additional custom logic to happen within my override. the standard decorating a decorator approach doesn't seem to work for me, I think because your decorator works on classmethods and optionally receives self/cls as a parm?
from ring.
Could you show me a specific scenario with an example? Ring decorator is designed to be used to top of the other decorators. But I am not sure if it can be a problem in some situations.
from ring.
I don't have an example as of right now. but I was thinking to abstract out connection and coder away (which your proposed solution solves) but also add something to schedule an async job to warm up the cache. but if you could show me a way to even have a print statement that'd do.
from ring.
Related Issues (20)
- Use functools.cached_property for python3.8+ HOT 1
- `@coroutine` decorator is about to deprecate
- Better support for variable number of arguments HOT 1
- Redis Exception on Data types HOT 4
- Add a runtime prefix to default cache key HOT 3
- New release to pip HOT 1
- Using json file as storage? HOT 2
- ring 0.8.0 + python 2.7.13 = AttributeError: 'module' object has no attribute 's' HOT 4
- Example code in document is not working
- Can't access ring-specific attributes on a cached property HOT 3
- ring.key - missing x required positional argument when using class HOT 4
- Can`t aioredis Cache HOT 1
- Dynamic expire config like expire_callback or expired_at
- Change version constraint in setup.py HOT 2
- Check python3.11 compatibility
- Why is occured the error - AttributeError: module 'ring.func.base' has no attribute 'transform_kwargs_only'? HOT 1
- TypeError when using positional-only parameters HOT 1
- Metaclass argument in class definition breaks caching for constructor HOT 2
- Unexpected behavior when arg is input as a string or literally same integer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ring.