Hi,
From my sanic app, I logged out the thread id, and I realized that the thread ids were different from different route.
and I also noticed that my one cpu intensive code did not block other route request which should block, from my understanding, sanic has one thread and one event loop, which should be blocked, but did not.
Can anyone help to explain this behavior? or did I mis-undestand the event loop and threading of asyncio?
It does not use threads. There is a single loop per worker. So, if you run with multiple workers, there are multiple loops.
Does multiple loops affect the Task.
What do you mean? What is the underlying question/issue you are dealing with?
A Task
only can exist on a single loop.