A simple redis lock.
Project description
Installation
pip install simple-redis-lock
Usage
from simple_redis_lock import get_simple_lock
import your_redis_client
with get_imple_lock(your_redis_client, 'my_lock_name', ex=30) as lock:
if lock:
print('get the lock, and do something, finish release the lock')
else:
print('do not get lock, return')
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
File details
Details for the file simple-redis-lock-0.1.2.tar.gz
.
File metadata
- Download URL: simple-redis-lock-0.1.2.tar.gz
- Upload date:
- Size: 1.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43a86410ea7d74e4cf4b83466b4d01a89f0c4ba9816d333f7cf08a4771eb6022 |
|
MD5 | 125b7d6a7633120c6e7b81761d5db0e8 |
|
BLAKE2b-256 | f46affdfd8ea7b30f5cce943d07abbfb510cc4e5f5dad39e2814a9e2a8835f0f |