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

View file

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