Content-Length: 301856 | pFad | https://github.com/python/cpython/issues/128041

ad Add `terminate_workers` to `ProcessPoolExecutor` · Issue #128041 · python/cpython · GitHub
Skip to content

Add terminate_workers to ProcessPoolExecutor #128041

Description

@csm10495

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/128041

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy