Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From the conclusion of the article:

> If you need to get a few URLS fast, a ThreadPoolExecutor is likely the Pareto solution, 99% of the time.

I agree with this. ThreadPoolExecutor is easy to use. In general, using threads in Python to handle concurrent I/O is pretty simple and plenty performant.



It’s a waste if you need coordination between the tasks though. Putting an async task aside and sending only dumb synchronous function calls that never wait is more efficient than blocking a thread while it waits on another.

asyncio with an executor is a good way to run complex tasks in parallel.


I'm not sure whether this was your intention, but I think you are in full agreement with the article.


Or just use an async Http client with a little asyncio snippet. Depends on what you're comfortable with and what code you have running already.

If you're a junior and have no clue, your best bet is to ask a senior in your team though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: