[issue22013] Add at least minimal support for thread groups
Claudiu Popa
report at bugs.python.org
Mon Jul 21 00:54:28 CEST 2014
Claudiu Popa added the comment:
This seems indeed like a weaker version of ThreadPoolExecutor. Here's how your example looks with it, not very different and still easy to understand and grasp:
from concurrent.futures import ThreadPoolExecutor
from urllib.request import urlretrieve
with ThreadPoolExecutor(max_workers=3) as executor:
url = 'http://www.{site}.org/'
for site in ('perl', 'python', 'jython', 'pypy'):
future = executor.submit(urlretrieve, url.format(site=site), site)
3 lines without imports and the initialisation of the pool.
----------
nosy: +Claudiu.Popa
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22013>
_______________________________________
More information about the Python-bugs-list
mailing list