db.py 文件源码

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

项目:pscheduler 作者: perfsonar 项目源码 文件源码
def wait(self, timeout=None):
        """
        Wait through 'timeout' (in seconds) for a notification, or forever
        if it is None.  Return True if a notification was received or
        False otherwise.
        """

        if timeout is not None:
            timeout = float(timeout)

        while True:
            try:
                selected = select.select([self.pg], [], [], timeout)
                break
            except select.error as ex:
                err_no, message = ex
                if err_no == errno.EINTR:
                    # TODO: This needs to adjust the time remaining
                    continue
                raise ex

        if selected == ([], [], []):
            return False

        self.pg.poll()
        self.__capture_notifications()
        return len(self.pending_notifications) > 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号