barrier.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:zoonado 作者: wglass 项目源码 文件源码
def wait(self, timeout=None):
        time_limit = None
        if timeout is not None:
            time_limit = time.time() + timeout

        barrier_lifted = self.client.wait_for_event(
            WatchEvent.DELETED, self.path
        )

        if time_limit:
            barrier_lifted = gen.with_timeout(time_limit, barrier_lifted)

        exists = yield self.client.exists(path=self.path, watch=True)
        if not exists:
            return

        try:
            yield barrier_lifted
        except gen.TimeoutError:
            raise exc.TimeoutError
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号