Distributed lock using EventStore?

Hi,

We are in need of a cluster wide distributed lock for some processes
and were wondering if anyone has used EventStore to implement such a
thing?

My idea would be, basically, a stream represents a lock, and last
written event determines which server "owns" the lock. The event
timestamp + lease time determines how long it lasts. When lease
expires another server can attempt to write an event to get the lock.
The quorum + versioning should determine who actually wins, and the
resulting event is read by all servers to find out who should do what.

Something like that.

Anyone tried already?

regards, Rickard

So there is an issue here in that you can end up with two servers who
think they own the lock for some period of time albeit small.