Support for trio via anyio #1932
Replies: 5 comments 3 replies
-
Hi @graingert ! However, there are some concerns we'd probably need to address before moving forward.
Generally speaking, we're more flexible when it comes to the test suite, so most of the above concerns do not apply there. Looking at https://github.com/encode/starlette/pull/1157/files, it doesn't look too heavy, particularly given that Falcon doesn't do certain types of wrapping automagic, adapters and built-in servers found in Starlette, however, it would still be good to get a feeling how big the required changes are. Maybe you could start from a limited MVP prototype, or even just a quick review what needs to be done in the codebase, just to prove feasibility; and we could take it from there? |
Beta Was this translation helpful? Give feedback.
-
I like the idea of doing some initial prototyping. Providing 100% test coverage for the ASGI paths can actually be more challenging vs. writing the implementation, so I would be interested in seeing how many additional paths anyio support would require (in addition to running our existing test suite against a trio-enabled Falcon app). I would also be interested in seeing if there are any strange edge cases that trio's behavior brings up that we would have to handle and test. If the changes are minimal, the edge cases few, and the dependencies are unlikely to see a lot of churn (i.e., the anyio/trio interfaces are stable) we can probably absorb the maintenance burden, esp. if we get some help. 😉 Also, echoing @vytas7, we would need to avoid introducing any significant performance degradations. And we would also need to avoid introducing a required dependency to Falcon, since having zero dependencies is indeed important to a segment of our community. In other words, we would need to make it possible to swap anyio/trio for asyncio without requiring any dependencies for a default Falcon installation. And again, doing so without introducing a performance regression. |
Beta Was this translation helpful? Give feedback.
-
Re dependencies, another point to consider is that the majority of Falcon users are likely still on WSGI, at least when it comes to existing code bases. For them, On the positive side, our direct usage of |
Beta Was this translation helpful? Give feedback.
-
I hope I'm not already sounding as a big naysayer, as I also love the ideas behind Trio! |
Beta Was this translation helpful? Give feedback.
-
Unfortunately this might get delayed even more on our side, as it seems Uvicorn has closed the respective issues both for HTTP/2 and Trio without fixing them. So unless there exists a performant, production ready ASGI server with Trio support, it will be hard for us to find motivation and time to invest into this. A community PR might still be considered though. |
Beta Was this translation helpful? Give feedback.
-
Starlette has recently added support for trio via anyio
And I'm interested in using falcon on trio too, and would be happy to help with a port to anyio
Beta Was this translation helpful? Give feedback.
All reactions