classification
Title: add initializer to concurrent.futures.ProcessPoolExecutor
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument
View: 21423
Assigned To: Nosy List: nvdv, pitrou
Priority: normal Keywords:

Created on 2017-08-08 14:02 by nvdv, last changed 2017-09-02 18:09 by pitrou. This issue is now closed.

Messages (4)
msg299921 - (view) Author: nvdv (nvdv) Date: 2017-08-08 14:02
Unfortunately concurrent.futures.ProcessPoolExecutor does not provide any means to interact with worker processes (like initializer function in multiprocessing.Pool constructor).

This problem has been mentioned at least once: 
https://mail.python.org/pipermail/python-dev/2014-March/133697.html.

It's not hard to work around this issue by subclassing ProcessPoolExecutor and adding all necessary methods, but IMO solution can be more generic.
msg300615 - (view) Author: nvdv (nvdv) Date: 2017-08-21 09:00
I can make a PR if it makes any sense for stdlib maintainer.
msg301166 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-02 18:05
That would sound like a reasonable addition, yes.
msg301167 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-09-02 18:09
Actually, looks like this was already proposed in issue 21423. Closing as duplicate.
History
Date User Action Args
2017-09-02 18:09:21pitrousetstatus: open -> closed
superseder: concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument
messages: + msg301167

resolution: duplicate
stage: resolved
2017-09-02 18:05:24pitrousetnosy: + pitrou

messages: + msg301166
versions: + Python 3.7, - Python 3.6
2017-08-21 09:00:21nvdvsetmessages: + msg300615
2017-08-08 14:02:29nvdvcreate