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
550 stars 78 forks source link

A question about recursive lock #118

Closed yuzaoyah closed 5 months ago

yuzaoyah commented 5 months ago

Hello. Does it now support recursive lock? Or is there a plan to implement it? If neither of them,could you tell me how to implement it using python-redis-lock? Tks.

ionelmc commented 5 months ago

Recursive as in a lock that has an internal counter and only actually releases when the counter is down to 0 (released as many times as it acquired)? No support for that, but you can implement that yourself, it's just a counter.

yuzaoyah commented 5 months ago

Recursive as in a lock that has an internal counter and only actually releases when the counter is down to 0 (released as many times as it acquired)? No support for that, but you can implement that yourself, it's just a counter.

Ok, tks.