Comments (4)
@TsingJyujing check this out https://zhuanlan.zhihu.com/p/101913195
from redlock-py.
- if u want to use watchdog feature, u can just use redission with java
- 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.
@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.
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)
- Add a license HOT 1
- Should raise `ValueError` and be more specific about exceptions in `def lock_instance` HOT 2
- Question: how do you keep the lock HOT 3
- Possible to check on lock status? HOT 1
- Fails with non-default setting of redis HOT 1
- Lock method does not work HOT 2
- Redis Cluster HOT 2
- retry_count = 0 or retry_delay = 0 not works, may be a bug?
- Add context manager support HOT 4
- NameError: name 'basestring' is not defined HOT 1
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 redlock-py.