Prevent active wait on the list of workers

This commit is contained in:
Fabio Manganiello 2019-12-15 19:50:47 +01:00
parent 6082eb62d5
commit d1ea69262a
1 changed files with 3 additions and 5 deletions

View File

@ -111,14 +111,12 @@ class Workers:
:ret: A list containing the processed responses :ret: A list containing the processed responses
""" """
while self._workers: while self._workers:
for i, wrk in enumerate(self._workers): wrk = self._workers.pop()
if not self._workers[i].is_alive(): wrk.join()
self._workers.pop(i)
break
self.responses = []
while not self.response_queue.empty(): while not self.response_queue.empty():
self.responses.append(self.response_queue.get()) self.responses.append(self.response_queue.get())
return self.responses return self.responses
def end_stream(self): def end_stream(self):