3 ms·
If you don’t use `async def` and you are using fastapi it’s easy to accidentally block the event loop.
by ibash 1y ago
If you don’t use `async def` and you are using fastapi it’s easy to accidentally block the event loop.
- ashishb 1y ago> it’s easy to accidentally block the event loop. Can you share a scenario where this would happen? I have deployed multiple machine learning and data analytics-focused web services, and this has never happened to me.
- winrid 1y agoWith a for loop? You probably don't know you are, or just aren't doing anything cpu intensive.
- chamoda 1y agoWell, you can even block event loop in `async def` if you are not careful. When you are using `async def` you need to do all your IO (disk, network) operations asynchronously or your are blocking the event loop.
- deleted 1y ago[deleted]