client.py 文件源码

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

项目:python-etcd3 作者: kragniz 项目源码 文件源码
def add_watch_callback(self, *args, **kwargs):
        """
        Watch a key or range of keys and call a callback on every event.

        If timeout was declared during the client initialization and
        the watch cannot be created during that time the method raises
        a ``WatchTimedOut`` exception.

        :param key: key to watch
        :param callback: callback function

        :returns: watch_id. Later it could be used for cancelling watch.
        """
        try:
            return self.watcher.add_callback(*args, **kwargs)
        except queue.Empty:
            raise exceptions.WatchTimedOut()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号