An example of how a `Lock` should re-act to client state changes?
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 Have you figured out how to do this i am struggling with it also?