feat: use uvloop or winloop to speed up asyncio

This commit is contained in:
WorldObservationLog
2024-05-22 14:05:11 +08:00
parent cc65d4782a
commit d5c077a263
4 changed files with 11 additions and 1773 deletions

View File

@@ -1,8 +1,15 @@
import asyncio
import sys
from src.cmd import NewInteractiveShell
if __name__ == '__main__':
if sys.platform in ('win32', 'cygwin', 'cli'):
import winloop
winloop.install()
else:
import uvloop
uvloop.install()
loop = asyncio.get_event_loop()
cmd = NewInteractiveShell(loop)
try: