I am using uvicorn and I need to use the existing event loop. I'm using the following command:
loop = asyncio.get_event_loop()
But when I use this line, the code get stuck. But if I use new_event_loop, I get the following error:
RuntimeError: Task <Task pending coro=<open_connection() running at /usr/lib/python3.6/asyncio/streams.py:81> cb=[_release_waiter(<Future pendi...sk._wakeup()]>)() at /usr/lib/python3.6/asyncio/tasks.py:316]> got Future <Future pending> attached to a different loop
Please help me to understand how to use the existing loop created by uvicorn.