source.py 文件源码

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

项目:reddit-service-websockets 作者: reddit 项目源码 文件源码
def pump_messages(self):
        """Maintain a connection to the broker and handle incoming frames.

        This will never return, so it should be run from a separate greenlet.

        """
        while True:
            try:
                self._connect()
                LOG.info("connected")

                while self.connected:
                    LOG.debug("pumping")
                    self.connection.read_frames()
                    gevent.sleep()
            except socket.error as exception:
                LOG.warning("connection failed: %s", exception)
                gevent.sleep(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号