def solve_tasks(self):
        done = 0
        stop = 0
        for task in self.tasks:
            stop+=1
            try:
                task.start()
                if stop==self.limit:
                    for t in range(stop):
                        task = self.tasks[t+done]
                        task.join()
                        self.result.append(task.result)
                        del task
                    done += stop
                    stop=0
            except Exception:
                print 'Unable to launch thread #%d' % (stop+done)

        if stop>0:
            for t in range(stop):
                task = self.tasks[t+done]
                task.join()
                self.result.append(task.result)
                del task
Launch all tasks and grab results
dataset/ETHPy150Open sysdream/pysqli/pysqli/core/async.py/AsyncPool.solve_tasks