def shutdown(self, block=False):
"""Prohibit further produce requests and attempt to flush all events currently in
the main and retry queues. After this attempt, all remaining events are made
available to an event handler but will otherwise be dropped. The producer
thread and IOLoop are also shut down. If block=True, this blocks until
the producer thread is dead and the shutdown event has been handled."""
logger.info('Client shutting down')
self.in_shutdown = True
self.io_loop.add_callback(self.producer.start_shutdown)
if block:
self.producer_thread.join()
logger.info('Client completed shutdown')
else:
logger.info('Client shutting down asynchronously, will not block')
评论列表
文章目录