-
Instead of calling run(), can I share the main asyncio loop with another module? For instance a network message receiver. |
Beta Was this translation helpful? Give feedback.
Answered by
rodja
Feb 1, 2023
Replies: 1 comment 1 reply
-
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 nicegui/examples/fastapi/main.py Line 17 in d095e67 I think you can simply add the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
smojef
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
nicegui/examples/fastapi/main.py
Line 17 in d095e67
I think you can simply add the
loop=...
parameter and be ready to go.