by lukin0110 · 5y ago · 0 comments
def blocking(): time.sleep(5)
@app.get("/") async def index(): blocking()
The `blocking` function will blocking the event loop. This is something you need to be aware of. Gist with a few scenarios: https://gist.github.com/lukin0110/0074ec5325224674010193bb95...
You don't always know that a function call is blocking, because you don't always know what is happening behind the scenes of that function and on what it depends.