Replies: 5 comments
-
After diving into the codebase and thinking about it some more we can get the same functionality by allowing passing This is a more lightweight solution which requires minimum implementation but allows power users to have more control over the execution environment of their |
Beta Was this translation helpful? Give feedback.
-
I started work on using the loop_factory kwargs here #2130 I never got around to finishing it |
Beta Was this translation helpful? Give feedback.
-
Hey, I took a look at the PR and it is indeed the direction I was going for. Are you ok with me committing the changes on the same PR? |
Beta Was this translation helpful? Give feedback.
-
I was about to start writing something like |
Beta Was this translation helpful? Give feedback.
-
I opened a PR adding this logic to the refactor @graingert started doing to the IOLoop handing mechanism Would really love to push this one forward. |
Beta Was this translation helpful? Give feedback.
-
Hey all,
I am currently developing a monitored ioloop.
The purpose of the project is to allow insights into the healthiness of a running ioloop, for example exporting with prometheus a histogram showing the execution time of each task on the ioloop.
I wanted to integrate this into our production FastAPI but saw that currently uvicorn only allows to pass two predefined loops (asyncio and uvloop).
What do you guys think about adding another CLI parameter called
loop-factory
which will contain an import path to a factory of type() -> BaseMonitoredEventLoopPolicy
.This will allow users to run uvicorn in any ioloop they choose to.
I am also ok with making it a fallback of the
loop
CLI param, however I find that implicit and confusing in my opinion.I will be more than happy to open a Pull request in case you like the idea :)
Beta Was this translation helpful? Give feedback.
All reactions