kopia lustrzana https://github.com/cirospaciari/socketify.py
clean uv loop stop
rodzic
6172288501
commit
e681d628b7
|
@ -60,6 +60,8 @@ class Loop:
|
||||||
pending = asyncio.all_tasks(self.loop)
|
pending = asyncio.all_tasks(self.loop)
|
||||||
# Run loop until tasks done
|
# Run loop until tasks done
|
||||||
self.loop.run_until_complete(asyncio.gather(*pending))
|
self.loop.run_until_complete(asyncio.gather(*pending))
|
||||||
|
# clean up uvloop
|
||||||
|
self.uv_loop.stop()
|
||||||
|
|
||||||
def run_once(self):
|
def run_once(self):
|
||||||
self.uv_loop.run_once()
|
self.uv_loop.run_once()
|
||||||
|
@ -70,8 +72,8 @@ class Loop:
|
||||||
self.loop._run_once()
|
self.loop._run_once()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
# Just mark as started = False and wait
|
||||||
self.started = False
|
self.started = False
|
||||||
self.uv_loop.stop()
|
|
||||||
|
|
||||||
# Exposes native loop for uWS
|
# Exposes native loop for uWS
|
||||||
def get_native_loop(self):
|
def get_native_loop(self):
|
||||||
|
|
Ładowanie…
Reference in New Issue