| 611 | |
| 612 | |
| 613 | class MultiprocessingPoolExecutor(Executor): |
| 614 | def __init__(self, pool): |
| 615 | self.pool = pool |
| 616 | self._max_workers = len(pool._pool) |
| 617 | |
| 618 | def submit(self, fn, *args, **kwargs): |
| 619 | return submit_apply_async(self.pool.apply_async, fn, *args, **kwargs) |
| 620 | |
| 621 | |
| 622 | def submit_apply_async(apply_async, fn, *args, **kwargs): |