summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorAnas <anas.el.amraoui@live.com>2022-06-01 14:59:02 +0300
committerGitHub <noreply@github.com>2022-06-01 14:59:02 +0300
commitfa0be7671de6be85f859cbb57a31531b2482c9e1 (patch)
tree5470f36a4094e413f88480da35a3980ba73999bf /redis/client.py
parent05fc203f68c24fbd54c7b338b4610fa62972c326 (diff)
downloadredis-py-fa0be7671de6be85f859cbb57a31531b2482c9e1.tar.gz
Made sync lock consistent and added types to it (#2137)
* Made sync lock consistent and added types to it * Made linters happy * Fixed cluster client lock signature Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
Diffstat (limited to 'redis/client.py')
-rwxr-xr-xredis/client.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py
index 58668ee..fcc2758 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -1098,6 +1098,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands):
name,
timeout=None,
sleep=0.1,
+ blocking=True,
blocking_timeout=None,
lock_class=None,
thread_local=True,
@@ -1113,6 +1114,12 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands):
when the lock is in blocking mode and another client is currently
holding the lock.
+ ``blocking`` indicates whether calling ``acquire`` should block until
+ the lock has been acquired or to fail immediately, causing ``acquire``
+ to return False and the lock not being acquired. Defaults to True.
+ Note this value can be overridden by passing a ``blocking``
+ argument to ``acquire``.
+
``blocking_timeout`` indicates the maximum amount of time in seconds to
spend trying to acquire the lock. A value of ``None`` indicates
continue trying forever. ``blocking_timeout`` can be specified as a
@@ -1155,6 +1162,7 @@ class Redis(AbstractRedis, RedisModuleCommands, CoreCommands, SentinelCommands):
name,
timeout=timeout,
sleep=sleep,
+ blocking=blocking,
blocking_timeout=blocking_timeout,
thread_local=thread_local,
)