Open Twbadkid opened 5 years ago
So you would like this code:
with Lock(blocking=False):
something
raise an exception and skip the something
?
An alternative api that doesn't mess with the __init__
could be:
with Lock().acquire_context(blocking=False):
something
So you would like this code:
with Lock(blocking=False): something
raise an exception and skip the
something
?
Yes.
Is it possible to add any of these solutions in this library?
@ionelmc Any chance to implement this? I can make a PR if you will review and merge
@tavor118sn sure, please make that PR.
Hi,
In
redis_lock/__init__.py
line: 341blocking
will always beTrue
when we use cache.lock inwith
block, Is it possible to set the parameter(blocking/timeout) from__init__
function or another function?