api: properly close the event loop
Close the event loop when the context is exited, which will clear the internal queues and shut down the executor of the event loop. Not doing this will create a warning when the object is garbage collected.
This commit is contained in:
parent
e9c4075bb3
commit
4c6ca0b4a0
1 changed files with 1 additions and 0 deletions
|
|
@ -70,3 +70,4 @@ class API:
|
|||
def __exit__(self, *args):
|
||||
self.event_loop.call_soon_threadsafe(self.event_loop.stop)
|
||||
self.thread.join()
|
||||
self.event_loop.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue