def _publish_wrapper(self, topic, headers, message):
while True:
try:
with publish_lock():
self.vip.pubsub.publish('pubsub', topic, headers=headers, message=message).get(timeout=10.0)
except gevent.Timeout:
_log.warn("Did not receive confirmation of publish to "+topic)
break
except Again:
_log.warn("publish delayed: " + topic + " pubsub is busy")
gevent.sleep(random.random())
except VIPError as ex:
_log.warn("driver failed to publish " + topic + ": " + str(ex))
break
else:
break
评论列表
文章目录