Home | Trees | Indices | Help |
---|
|
object --+ | Lock
A shared, distributed Lock. Using Redis for locking allows the Lock to be shared across processes and/or machines.
It's left to the user to resolve deadlock issues and make sure multiple clients play nicely together.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Class Variables | |
LOCK_FOREVER = 2147483649.0
|
Properties | |
Inherited from |
Method Details |
Create a new Lock instnace named ``name`` using the Redis client supplied by ``redis``. ``timeout`` indicates a maximum life for the lock. By default, it will remain locked until release() is called. ``sleep`` indicates the amount of time to sleep per loop iteration when the lock is in blocking mode and another client is currently holding the lock. Note: If using ``timeout``, you should make sure all the hosts that are running clients have their time synchronized with a network time service like ntp.
|
Use Redis to hold a shared, distributed lock named ``name``. Returns True once the lock is acquired. If ``blocking`` is False, always return immediately. If the lock was acquired, return True, otherwise return False. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Aug 26 15:54:15 2015 | http://epydoc.sourceforge.net |