Use uvloop to make asyncio faster

This commit is contained in:
miruka 2019-07-10 00:05:42 -04:00
parent d091f3bcb6
commit 58ebe6475e

View File

@ -8,6 +8,7 @@ from pathlib import Path
from threading import Thread from threading import Thread
from typing import Any, Coroutine, Dict, List, Optional, Sequence from typing import Any, Coroutine, Dict, List, Optional, Sequence
import uvloop
from appdirs import AppDirs from appdirs import AppDirs
import pyotherside import pyotherside
@ -38,6 +39,7 @@ class App:
def _loop_starter(self) -> None: def _loop_starter(self) -> None:
asyncio.set_event_loop(self.loop) asyncio.set_event_loop(self.loop)
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
self.loop.run_forever() self.loop.run_forever()