kazoo icon indicating copy to clipboard operation
kazoo copied to clipboard

An example of how a `Lock` should re-act to client state changes?

Open teeeg opened this issue 6 years ago • 1 comments

When using a Lock, the docs recommend:

It’s highly recommended to add a state listener with add_listener() and watch for LOST and SUSPENDED state changes and re-act appropriately. In the event that a LOST state occurs, its certain that the lock and/or the lease has been lost.

Is there a good example of how to create a lock, acquire it and re-act to client state changes? I know it may vary depending on the context of the operation -- but I'd love to see how some people are wiring up the add_listener to the Lock and specifically re-acting to changes in state.

I would be happy to add a few examples to the docs, just trying to understand some common patterns before I attempt that.

teeeg avatar May 31 '19 04:05 teeeg

@teeeg Have you figured out how to do this i am struggling with it also?

awol-linux avatar Sep 10 '21 01:09 awol-linux