2 ms·
> If you do anything on the CPU or if you have any I/O which is not async you stall the event loop and everything grinds to a halt. But that's always going to
by tbabb 5y ago
> If you do anything on the CPU or if you have any I/O which is not async you stall the event loop and everything grinds to a halt.
But that's always going to be the case for single threaded code. If you're ready to use threads, then that integrates pretty seamlessly with asyncio by using an executor task.
> asyncio doesn't give us any tools to protect the event loop from getting stalled by your code
Again, check out executors: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor https://docs.python.org/3/library/asyncio-eventloop.html#asy...
Asyncio in Python and JS are very different beasts.