Giter Site home page Giter Site logo

Comments (4)

eedalong avatar eedalong commented on July 28, 2024 1

@TsingJyujing check this out https://zhuanlan.zhihu.com/p/101913195

from redlock-py.

eedalong avatar eedalong commented on July 28, 2024

@TsingJyujing

  1. if u want to use watchdog feature, u can just use redission with java
  2. I've been thinking about this problem this morning, and I came to a rough conclusion that, if we dont want write a new redis client, maybe multithread can be one of the solutions to this problem.I mean use another thread to check and extend the lock for N secs. This can ensure that
    a) if the server goes down, the thread also dies, and the lock will not be extended, so the lock can be auto released by redis
    however, this solution may have some bad effect on the performance of the worker thread.

from redlock-py.

TsingJyujing avatar TsingJyujing commented on July 28, 2024

@eedalong
Thank you for reply!!!!

I can't use Java because I'm writing a server with Python (the deep reason is PIL is convient in Python and Java do not have a such useful lib).

And I think it's also tricky to stop/kill the thread, I think we should use context manager to make a high level API to manage these troublism things like we described in #25 .

If you have intention to make this high level API, I'd like to make a PR, how about you idea?

from redlock-py.

brainix avatar brainix commented on July 28, 2024

Pottery’s implementation of Redlock has an .extend() method that does what you’re looking for. Disclaimer: I develop/maintain Pottery. Good luck!

from redlock-py.

Related Issues (11)

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.