kopia lustrzana https://github.com/cirospaciari/socketify.py
fix libuv blocking without need
rodzic
f006601588
commit
7adfb90ccf
|
@ -34,6 +34,7 @@ class Loop:
|
||||||
asyncio.set_event_loop(self.loop)
|
asyncio.set_event_loop(self.loop)
|
||||||
|
|
||||||
self.uv_loop = UVLoop()
|
self.uv_loop = UVLoop()
|
||||||
|
self.call_uv_next = False
|
||||||
|
|
||||||
if hasattr(exception_handler, "__call__"):
|
if hasattr(exception_handler, "__call__"):
|
||||||
self.exception_handler = exception_handler
|
self.exception_handler = exception_handler
|
||||||
|
@ -75,9 +76,10 @@ class Loop:
|
||||||
def create_future(self):
|
def create_future(self):
|
||||||
return self.loop.create_future()
|
return self.loop.create_future()
|
||||||
|
|
||||||
|
|
||||||
def _keep_alive(self):
|
def _keep_alive(self):
|
||||||
if self.started:
|
if self.started:
|
||||||
self.uv_loop.run_once()
|
self.uv_loop.run_nowait()
|
||||||
self.loop.call_soon(self._keep_alive)
|
self.loop.call_soon(self._keep_alive)
|
||||||
|
|
||||||
def create_task(self, *args, **kwargs):
|
def create_task(self, *args, **kwargs):
|
||||||
|
|
Ładowanie…
Reference in New Issue