Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trio support #24

Open
jordaneremieff opened this issue Jan 28, 2019 · 4 comments
Open

Trio support #24

jordaneremieff opened this issue Jan 28, 2019 · 4 comments
Labels
feature New feature or request maybe Just an idea

Comments

@jordaneremieff
Copy link
Owner

So I admittedly don't know how much may be involved here, but my initial thoughts are that including support for ASGI applications using Trio wouldn't require too much to implement as an adapter here.

@jordaneremieff jordaneremieff added feature New feature or request maybe Just an idea labels Jan 28, 2019
@tomchristie
Copy link

So... The only place you're using asyncio is for a single Queue instance. For trio, you'd need to swap that out with a trio Queue implementation instead.

The ASGI interface itself is agnostic - it's an async/await interface, rather than specifically being an asyncio interface.

(Broader context, Trio is obviously a huge step forwards, but I'm personally lukewarm on the ecosystem split it requires vs. bringing the learnings it introduces into asyncio.)

@jordaneremieff
Copy link
Owner Author

@tomchristie Hm, interesting point about the broader context. I haven't really delved into Trio too deeply, but I've only heard good things about it and have seen various efforts to use it with ASGI.

That said, I don't have any particular interest in using it myself. I'm going to leave this as a "maybe" and won't likely do anything further, but if there are enough people that would find an ASGI Trio adapter useful I would be open to a PR.

@tomchristie
Copy link

Codewise I think it just needs a trivial change to use trio.Event() in mangum/asgi/protocol.py (Tho I'm not sure how best you'd expose that as a switch.) Anyways, leaving this here, for someone else to make progress on if it ends up being a requirement for someone, somewhere

@jordaneremieff
Copy link
Owner Author

jordaneremieff commented Feb 7, 2020

Starlette is considering support for Trio here and that would make at least two frameworks that support Trio (Quart being the other) - might be worth including here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request maybe Just an idea
Projects
None yet
Development

No branches or pull requests

2 participants