Hi all, I've have recently been playing around with the idea of using pyo3 to facilitate the transition from an existing python based webserver projects (specifically ASGI ones like FastAPI) to rust, and the result is this crate:
Basically it provides the ASGI server part of a python ASGI puzzle (same as what something like Uvicorn provides for a python ASGI application) as an Axum handler that can be used as a fallback handler to call the python code for routes that don't exist in rust/axum. You can find a simple example here.
It's not seen any real-world use yet. I've been using it to convert one module from one of my job's projects route by route, but it's slow going as it's still in my spare time. Also on the last route I was working on I hit some roadblocks dealing with the test suite using monkeypatching to manipulate time in places that is just impossible to make work in rust, so i'll need to rewrite those tests to avoid the monkeypatching before I continue further. But apart from that I've been happy with how it worked out so far, and already have some code that could be pushed into production (if we can convince the client to also get on board), so I thought it could be interesting to others as it is now.
I've also written a quick blog post to describe the motivation behind it.