_client_tx.py 文件源码

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

项目:txaio-etcd 作者: crossbario 项目源码 文件源码
def watch(self, keys, on_watch, filters=None, start_revision=None, return_previous=None):
        """
        Watch one or more keys or key sets and invoke a callback.

        Watch watches for events happening or that have happened. The entire event history
        can be watched starting from the last compaction revision.

        :param keys: Watch these keys / key sets.
        :type keys: list of bytes or list of instance of :class:`txaioetcd.KeySet`

        :param on_watch: The callback to invoke upon receiving
            a watch event.
        :type on_watch: callable

        :param start_revision: start_revision is an optional
            revision to watch from (inclusive). No start_revision is "now".
        :type start_revision: int
        """
        d = self._start_watching(keys, on_watch, filters, start_revision, return_previous)

        def on_err(err):
            if err.type == CancelledError:
                # swallow canceling!
                pass
            else:
                return err

        d.addErrback(on_err)

        return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号