keijack / python-eureka-client

A eureka client written in python. Support registering your python component to Eureka Server, as well as calling remote services by pulling the the Eureka registry.
MIT License
183 stars 43 forks source link

FastAPI Cannot run the event loop while another loop is running #76

Open Chandan746 opened 1 year ago

Chandan746 commented 1 year ago

I am using this package in my FastAPI project having async function.

  1. eureka_client.init(....) --> Success
  2. eureka_client.do_service(......) --> Cannot run the event loop while another loop is running
keijack commented 1 year ago

In async fun, please use

res = await eureka_client.do_service_async(...)
ahbe commented 9 months ago

You can use import nest_asyncio nest_asyncio.apply()