Add winloop as a performance enhancement

This commit is contained in:
Vizonex 2024-06-27 13:45:06 -05:00 committed by J.Townsend
parent 3ce1493e53
commit 99f05369f3

View file

@ -11,7 +11,12 @@ def main():
import multiprocessing
multiprocessing.freeze_support()
asyncio.DefaultEventLoopPolicy = asyncio.WindowsSelectorEventLoopPolicy
try:
# See if we have winloop as a performance enhancement on windows
import winloop
asyncio.DefaultEventLoopPolicy = winloop.EventLoopPolicy
except ModuleNotFoundError:
asyncio.DefaultEventLoopPolicy = asyncio.WindowsSelectorEventLoopPolicy
else:
import uvloop