Skip to content

Is it possible to share the async loop? #326

Closed Answered by rodja
smojef asked this question in Q&A
Discussion options

You must be logged in to vote

The event loop is started by Uvicorn. You would need to pass the existing loop into uvicorn on start as shown in https://stackoverflow.com/a/66275953/364388. In our custom FastAPI example the uvicorn call is made explicit

uvicorn.run(app, host='0.0.0.0', port=8000)

I think you can simply add the loop=... parameter and be ready to go.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@smojef
Comment options

Answer selected by smojef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants