Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 - Python library for async concurrency and I/O #310

Closed
dsantosfff opened this issue Jun 12, 2019 · 7 comments · Fixed by #3372
Closed

Trio - Python library for async concurrency and I/O #310

dsantosfff opened this issue Jun 12, 2019 · 7 comments · Fixed by #3372
Labels
question Question or problem question-migrate

Comments

@dsantosfff
Copy link

Description

Hello!
I'm using Hypercorn with uvloop.
I'd like to use Hypercorn with trio, but the program doesn't start when i switch uvloop by trio.

Do you have plans to implement trio?

Thank's!

PS: Nice work.

@dsantosfff dsantosfff added the question Question or problem label Jun 12, 2019
@haizaar
Copy link
Contributor

haizaar commented Jun 19, 2019

I guess most FastAPI users use it with uvloop which trio is not compatible with: python-trio/trio#138

@tiangolo
Copy link
Owner

Thanks for the help here @haizaar ! Nice investigation.

I think @haizaar is right, by checking that issue.

@idmitrievsky
Copy link

idmitrievsky commented Jul 22, 2019

This is a great place to mention that you can use hypercorn, which seems to support trio (I haven't tested it personally though).

@haizaar
Copy link
Contributor

haizaar commented Jul 22, 2019

Maybe, again maybe, if you configure uvicorn to use asyncio instead of uvloop as its loop, trio will work with it and consequently, with FastAPI

Of course that's in case one does not need absolutely cutting edge performance.

@tiangolo
Copy link
Owner

tiangolo commented Feb 10, 2020

So, FastAPI uses Starlette's run_in_threadpool internally, and that uses asyncio.

Prior to FastAPI supporting Trio, we would need Starlette itself to support Trio. But that's probably quite a lot of work there. Also, if Starlette supported Trio that would be automatically inherited by FastAPI.

You can track it here: encode/starlette#811

@github-actions
Copy link
Contributor

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

@graingert
Copy link
Contributor

there's some progress on this here: encode/starlette#1157

@tiangolo tiangolo changed the title [QUESTION] Trio - Python library for async concurrency and I/O Trio - Python library for async concurrency and I/O Feb 24, 2023
@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #8138 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question or problem question-migrate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants