(cls, cache, taskqueue, ctx, Process, processes,
pool, inqueue, outqueue, initializer, initargs,
maxtasksperchild, wrap_exception, sentinels,
change_notifier)
| 505 | |
| 506 | @classmethod |
| 507 | def _handle_workers(cls, cache, taskqueue, ctx, Process, processes, |
| 508 | pool, inqueue, outqueue, initializer, initargs, |
| 509 | maxtasksperchild, wrap_exception, sentinels, |
| 510 | change_notifier): |
| 511 | thread = threading.current_thread() |
| 512 | |
| 513 | # Keep maintaining workers until the cache gets drained, unless the pool |
| 514 | # is terminated. |
| 515 | while thread._state == RUN or (cache and thread._state != TERMINATE): |
| 516 | cls._maintain_pool(ctx, Process, processes, pool, inqueue, |
| 517 | outqueue, initializer, initargs, |
| 518 | maxtasksperchild, wrap_exception) |
| 519 | |
| 520 | current_sentinels = [*cls._get_worker_sentinels(pool), *sentinels] |
| 521 | |
| 522 | cls._wait_for_updates(current_sentinels, change_notifier) |
| 523 | # send sentinel to stop workers |
| 524 | taskqueue.put(None) |
| 525 | util.debug('worker handler exiting') |
| 526 | |
| 527 | @staticmethod |
| 528 | def _handle_tasks(taskqueue, put, outqueue, pool, cache): |
nothing calls this directly
no test coverage detected