I would like to request 100 urls at a time and am currently doing this:
responses = list(PoolExecutor(max_workers=NUM_PARALLEL).map(
lambda xml: requests.post(URL, headers=HEADERS, data={'message': xml}),
xmls))
A few questions on this:
- Is
list
the best way to 'evaluate' the actual generator object/expression? Unless I dolist
I just get something like:<generator object Executor.map.<locals>.result_iterator at 0x10ecf9888>
- Is
PoolExecutor
used frequently to do parallel network requests in python3, or are there are other methods that are more preferable? - What are the differences between
PoolExecutor
,AsyncIO
andconcurrent.futures
to do something like this?