Why doesn't asyncio always use executors?
问题 I have to send a lot of HTTP requests, once all of them have returned, the program can continue. Sounds like a perfect match for asyncio . A bit naively, I wrapped my calls to requests in an async function and gave them to asyncio . This doesn't work. After searching online, I found two solutions: use a library like aiohttp, which is made to work with asyncio wrap the blocking code in a call to run_in_executor To understand this better, I wrote a small benchmark. The server-side is a flask