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)
评论列表
文章目录