- etcd3-py version: latest
- Python version: 2.7.5
- Operating System: CENTOS 7.5
Description
Maybe this is a Python thing I can work out, but I'm trying to have a watcher that'll self cancel within an event callback. Like watch once, or watch until some condition is satisfied, then cancel itself.
I've designed a kind of request/approval protocol on top of etcd and I'd like the watch to end when my approval watch fires. Any suggestions?
Excellent, stable library BTW. Thanks!
What I Did
def watch_apr(ev):
k = ev.key
v = ev.value
# cancel here somehow
apr_watcher.onEvent(EventType.PUT, watch_apr)
apr_watcher.runDaemon()
while apr_watcher <> None:
time.sleep(1)
Description
Maybe this is a Python thing I can work out, but I'm trying to have a watcher that'll self cancel within an event callback. Like watch once, or watch until some condition is satisfied, then cancel itself.
I've designed a kind of request/approval protocol on top of etcd and I'd like the watch to end when my approval watch fires. Any suggestions?
Excellent, stable library BTW. Thanks!
What I Did