(worker_id: int)
| 183 | pool = [DiscoPopenWorker(i, num_workers, num_groups, entrypoint) for i in range(1, num_workers)] |
| 184 | |
| 185 | def result_func(worker_id: int): |
| 186 | nonlocal pool |
| 187 | if worker_id != 0: |
| 188 | read_fd, write_fd = pool[worker_id - 1].start() |
| 189 | return Shape([read_fd, write_fd]) |
| 190 | del pool |
| 191 | return None |
| 192 | |
| 193 | return result_func |