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
listthe best way to 'evaluate' the actual generator object/expression? Unless I dolistI just get something like:<generator object Executor.map.<locals>.result_iterator at 0x10ecf9888> - Is
PoolExecutorused frequently to do parallel network requests in python3, or are there are other methods that are more preferable? - What are the differences between
PoolExecutor,AsyncIOandconcurrent.futuresto do something like this?