Open k-jingyang opened 11 months ago
https://github.com/samuel/go-zookeeper/pull/168/files
I realised that an unmerged PR in the original repo tries to do something similar, by implementing a timeout. However, the timeout may also not be ideal because
Hello,
Thanks for this open source library. I was looking into Lock() and realised that it blocks until a lock is acquired.
We have a use case where we have multiple instances trying to acquire the lock and we want to return an error immediately for instances that did not acquire the lock instead of waiting to acquire the lock. Is this achievable?
Calling Exists() before Lock() is not an ideal solution because reads are not linearizable in ZooKeeper.
Thanks!