cluster.py 文件源码

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

项目:deb-python-cassandra-driver 作者: openstack 项目源码 文件源码
def add_errback(self, fn, *args, **kwargs):
        """
        Like :meth:`.add_callback()`, but handles error cases.
        An Exception instance will be passed as the first positional argument
        to `fn`.
        """
        run_now = False
        with self._callback_lock:
            # Always add fn to self._errbacks, even when we're about to execute
            # it, to prevent races with functions like start_fetching_next_page
            # that reset _final_exception
            self._errbacks.append((fn, args, kwargs))
            if self._final_exception:
                run_now = True
        if run_now:
            fn(self._final_exception, *args, **kwargs)
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号