1

The typical approach for gRPC AsyncIO is

await server.start()
try:
  await server.wait_for_termination()
except:
  ...

But I was wondering rather than dealing with it via a hard stop because wait_for_termination just blocks forever until canceled if I can use asyncio.Event.wait() so I can trigger the termination of the server more cleanly.

Looking at the code for wait_for_termination it goes down to some C bindings so I am not sure if it may be doing anything else special or if asyncio.Event.wait() which I presume would use asyncio loop implementation more effectively (like Windows has it's own loop implementation that's different from UNIX).

As for my integration tests, them seem to pass so I am.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.