csm10495 · GitHub

Feature or enhancement

Proposal:

This is an interpretation of the feature ask in: https://discuss.python.org/t/cancel-running-work-in-processpoolexecutor/58605/1. It would be a way to stop all the workers running in a ProcessPoolExecutor

p = ProcessPoolExecutor()
# use p
# i know i want p to die at this point no matter what
p.terminate_workers()

Previously the way to do this was to use to loop through the ._processes of the ProcessPoolExecutor though, preferably this should be possible without accessing implementation details.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/cancel-running-work-in-processpoolexecutor/58605/1

Linked PRs

Read the original on github.com ↗