You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello. I am currently running a FastAPI application via Uvicorn worker.
I would like to know if my understanding of the behavior of Uvicorn worker is correct.
If you run a single Uvicorn worker, you can use the
One process and a main thread are created, and the main thread manages the event loop.
All requests (functions to be executed) are stacked in order in the event loop and queued in order.
If a request is defined as async, the event loop treats that action as asynchronous.
If the request is defined as def, the event loop creates a thread to handle the task as multithreaded, and the event loop proceeds to the next task in the queue.
That's how I understand it, is there anything I'm misunderstanding?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hello. I am currently running a FastAPI application via Uvicorn worker.
I would like to know if my understanding of the behavior of Uvicorn worker is correct.
If you run a single Uvicorn worker, you can use the
One process and a main thread are created, and the main thread manages the event loop.
All requests (functions to be executed) are stacked in order in the event loop and queued in order.
If a request is defined as async, the event loop treats that action as asynchronous.
If the request is defined as def, the event loop creates a thread to handle the task as multithreaded, and the event loop proceeds to the next task in the queue.
That's how I understand it, is there anything I'm misunderstanding?
Beta Was this translation helpful? Give feedback.
All reactions