4 ms·
> the minute you want to use a sync api from within async/await code it becomes a nightmare to manage What's wrong with sending the sync code to a thread pool?
by joconde 5y ago
> the minute you want to use a sync api from within async/await code it becomes a nightmare to manage
What's wrong with sending the sync code to a thread pool? My CPU-, disk- and database-intensive application is filled with calls like:
result = await asyncio.to_thread(long_function())
...and its resource usage and performance are great.