GithubHelp home page GithubHelp logo

Comments (4)

youknowone avatar youknowone commented on June 12, 2024

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.

striveforbest avatar striveforbest commented on June 12, 2024

@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.

youknowone avatar youknowone commented on June 12, 2024

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.

striveforbest avatar striveforbest commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.