Message252067
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? |
|
Date |
User |
Action |
Args |
2015-10-01 22:09:12 | Antony.Lee | set | recipients:
+ Antony.Lee |
2015-10-01 22:09:12 | Antony.Lee | set | messageid: <1443737352.06.0.289026067314.issue25293@psf.upfronthosting.co.za> |
2015-10-01 22:09:12 | Antony.Lee | link | issue25293 messages |
2015-10-01 22:09:11 | Antony.Lee | create | |
|