一个用redis做的分布式锁,含有超时及重试机制.
Project description
redis_netlock
---------------
Implements a distributed transaction using redis or
a redis compatible storage.
Example
-------
Basic example of usage::
from __future__ import with_statement
import redis
import time
from redis_netlock import dist_lock
client = redis.Redis(connection_pool=redis.BlockingConnectionPool(max_connections=15, host='localhost', port=6379))
with dist_lock('test', client):
time.sleep(10)
print 'welcome to my blog, http://xiaorui.cc'
---------------
Implements a distributed transaction using redis or
a redis compatible storage.
Example
-------
Basic example of usage::
from __future__ import with_statement
import redis
import time
from redis_netlock import dist_lock
client = redis.Redis(connection_pool=redis.BlockingConnectionPool(max_connections=15, host='localhost', port=6379))
with dist_lock('test', client):
time.sleep(10)
print 'welcome to my blog, http://xiaorui.cc'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
redis_netlock-1.0.tar.gz
(2.0 kB
view hashes)