[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2017-11-02 Thread Antony Lee

Antony Lee  added the comment:

I can't say I *really* need this anymore, but note that 
https://bugs.python.org/issue21423 is less general as it does not handle the 
case of a finalizer as proposed here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2017-11-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'd rather close this in favour of issue21423.

--
nosy: +pitrou
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor 
should accept an initializer argument

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-02 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-01 Thread Antony Lee

New submission from Antony Lee:

http://bugs.python.org/issue21423 and http://bugs.python.org/issue24980 suggest 
adding an initializer/on_new_thread argument to {Thread,Process}PoolExecutor.  
I would like to suggest a more unified API, that would allow not only handling 
initialization, but also finalization, by adding a {thread,process}_class 
attribute / constructor argument to {Thread,Process}PoolExecutor, so that one 
could do:

class MyThread(Thread):
def run(self):
initialize()
try: super().run()
finally: finalize()

with ThreadPoolExecutor(thread_class=MyThread): ...

Thoughts?

--
components: Library (Lib)
messages: 252067
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Hooking Thread/Process instantiation in concurrent.futures.
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com