Metadata-Version: 2.1
Name: redlock-dist
Version: 1.0.0
Summary: Distributed locks with Redis
Home-page: https://github.com/kerol/redlock-dist
Author: kerol
Author-email: ikerol@163.com
License: UNKNOWN
Description: ### redlock-dist
        Implementation of distributed locking with [Redis](https://redis.io)
        
        [Distributed locks with Redis](https://redis.io/topics/distlock)
        
        ### Usage
        Install:
        
        ```
        pip install redlock-dist
        ```
        
        example:
        
        ```
        
        from redis import StrictRedis
        from redlock_dist import RedLock
        
        rds = StrictRedis(host='localhost', port=6379, db=0)
        
        with RedLock(rds, 'key-name') as red_lock:
            if red_lock:
                print('get lock')
            else:
                print('do not get lock')
        ```
        
        ### Principle and notes
        Because Redis is single-threaded and you can use `SET key value NX PX expires`
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown
