Bring the number of pool processes up to the specified number, for use after reaping workers which have exited.
(ctx, Process, processes, pool, inqueue,
outqueue, initializer, initargs,
maxtasksperchild, wrap_exception)
| 313 | |
| 314 | @staticmethod |
| 315 | def _repopulate_pool_static(ctx, Process, processes, pool, inqueue, |
| 316 | outqueue, initializer, initargs, |
| 317 | maxtasksperchild, wrap_exception): |
| 318 | """Bring the number of pool processes up to the specified number, |
| 319 | for use after reaping workers which have exited. |
| 320 | """ |
| 321 | for i in range(processes - len(pool)): |
| 322 | w = Process(ctx, target=worker, |
| 323 | args=(inqueue, outqueue, |
| 324 | initializer, |
| 325 | initargs, maxtasksperchild, |
| 326 | wrap_exception)) |
| 327 | w.name = w.name.replace('Process', 'PoolWorker') |
| 328 | w.daemon = True |
| 329 | w.start() |
| 330 | pool.append(w) |
| 331 | util.debug('added worker') |
| 332 | |
| 333 | @staticmethod |
| 334 | def _maintain_pool(ctx, Process, processes, pool, inqueue, outqueue, |