def wait_on_sibling(self, sibling, time_limit=None):
log.debug("Waiting on sibling %s", sibling)
path = self.sibling_path(sibling)
unblocked = self.client.wait_for_event(WatchEvent.DELETED, path)
if time_limit:
unblocked = gen.with_timeout(time_limit, unblocked)
exists = yield self.client.exists(path=path, watch=True)
if not exists:
unblocked.set_result(None)
try:
yield unblocked
except gen.TimeoutError:
raise exc.TimeoutError
评论列表
文章目录