Prevent active wait on the list of workers
This commit is contained in:
parent
6082eb62d5
commit
d1ea69262a
1 changed files with 3 additions and 5 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue