def run(self):
while (not self.kill) and (self.running or not self.pool.queue.empty()):
try:
item = self.pool.queue.get(timeout=self.get_timeout)
except six.moves.queue.Empty:
continue
self.pool.queue_get_lock.acquire()
self.pool.queue_processed += 1
num = self.pool.queue_processed
self.pool.queue_get_lock.release()
try:
self.process(item, num)
except:
self.failed = True
self.pool.exceptions.append(sys.exc_info())
self.pool.kill()
评论列表
文章目录