The Sanic framework is currently gaining steam as a great Python 3 based framework running on uvloop. Since I use Falcon for Python 2 (PyPy), has there been consideration in tapping into uvloop for Falcon? Heck, even if uvloop is not installed or available (like lets say PyPy3 3.5), it takes advantage of asyncio.
I know that Sanic also uses aiofiles and httptools
Hi @btegs, this is something that's been on my radar for a while, and I'm hoping to dig into async support during this year's PyCon sprint (anyone interested is welcome to join). The tricky bits are that (1) there is no async 'WSGI' standard to target and (2) we need to continue supporting WSGI alongside asyncio and twisted (I'd like to support both of those frameworks if possible) without forking Falcon (when I told Glyph I was planning to add native support in lieu of creating a txFalcon project, he was rather pleased to hear it).
there is no async 'WSGI' standard to target
Although it's a moving target, the work here http://www.uvicorn.org/ is definitely now getting towards a usable asyncio WSGI-equivalent interface, and a corresponding server implementation.
It'd be interested to consider if that callable interface could be integrated against Falcon's request/response cycle, and what API modifications would be needed (either side) in order to do so.
@kgriffs - How did the sprint at PyCon go this year?
@tomchristie I've been thinking the same thing. I've been meaning to carve out some time and try hooking up the two, but lately I've been caught up with work related projects. Hopefully, I'll have some time here soon to give it a shot. Great job on those docs btw!
No great hurry, just good to get the conversation rolling. I'm more than willing to lend a hand further down the line if that ends up being useful. The most obvious points of difference will be supporting co-routine handler methods, and any API around streaming request/response bodies.
(Dropping this here for future reference: https://github.com/django/asgiref/blob/master/specs/asgi.rst)
I've done some prototyping around this that looks promising. Stay tuned. :)
@kgriffs What do you think of starlette which uses uvicorn that wraps upon uvloop?
https://www.uvicorn.org/
https://www.starlette.io/
Hello everyone!
We have since decided to standardize our async efforts on ASGI.
I'm closing this issue as a duplicate of our ongoing ASGI work, see also:
Our road to Falcon 3.0 (supporting ASGI, among other things) is tracked here: https://gist.github.com/kgriffs/a719c84aa33069d8dcf98b925135da39
Most helpful comment
I've done some prototyping around this that looks promising. Stay tuned. :)