ionelmc / python-redis-lock

Lock context manager implemented via redis SET NX EX and BLPOP.
https://pypi.python.org/pypi/python-redis-lock
BSD 2-Clause "Simplified" License
551 stars 77 forks source link

[Feature Request] Support floating point timeouts #113

Open darintay opened 8 months ago

darintay commented 8 months ago

Would be nice to be able to set timeout <1s, especially for tests which otherwise have to wait 1s each time.

I see a related 2015 issue - https://github.com/ionelmc/python-redis-lock/issues/16 - but since then Redis blpop added support for float timeouts (2020):

https://redis.io/commands/blpop/

Starting with Redis version 6.0.0: timeout is interpreted as a double instead of an integer.

I wonder if all that is required is to stop casting timeout to an int?