def stop(self):
"""Wait for the worker threads to process all items in queue.
This method blocks until there is no more work left.
It is essential to call this method. If you do any work in between
``start`` and ``stop``, make sure the ``stop`` method will always be
called, otherwise the program will never exit.
"""
for i in self.threads:
i.running = False
for i in self.threads:
i.join()
if self.exceptions:
exc_info = self.exceptions[0]
six.reraise(exc_info[0], exc_info[1], exc_info[2])
评论列表
文章目录