errorception / redis-lock

Implements a locking primitive using redis. An implementation of the algorithm described at https://redis.io/commands/setnx
211 stars 48 forks source link

Is it possible to have `acquire` wait forever #27

Closed paulgrove closed 4 years ago

paulgrove commented 4 years ago

I would like a Mutex that may possibly wait forever, is this possible?

rakeshpai commented 4 years ago

TBH, I'm not sure. You could try setting the timeout to Infinity. The timeout value is just passed along to redis as is, so it depends on what the redis lib supports, and what it sends to the redis server itself. Sorry I don't have a better answer. You'll just have to try it. It would be great if you can report back with your findings.