Skip to content

Commit

Permalink
Integrate uvloop and winloop support
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 committed Nov 3, 2023
1 parent 5c17f4d commit 6c1206d
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 11 deletions.
15 changes: 5 additions & 10 deletions bot/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@

from rodhaj import Rodhaj

# Only used for Windows development
# if os.name == "nt":
# asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
# else:
# try:
# import uvloop

# asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
# except ImportError:
# pass
if os.name == "nt":
from winloop import install
else:
from uvloop import install

load_dotenv()

Expand All @@ -45,6 +39,7 @@ async def main() -> None:

def launch() -> None:
with RodhajLogger():
install()
asyncio.run(main())


Expand Down
86 changes: 85 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ python = ">=3.9,<3.12"
discord-py = {extras = ["speed"], version = "^2.3.2"}
python-dotenv = "^1.0.0"
uvloop = {markers = "sys_platform != \"win32\"", version = "^0.19.0"}
winloop = {markers = "sys_platform == \"win32\"", version = "^0.0.9"}
asyncpg = "^0.28.0"
discord-ext-menus = {git = "https://github.com/Rapptz/discord-ext-menus", rev = "8686b5d1bbc1d3c862292eb436ab630d6e9c9b53"}
psutil = "^5.9.6"
Expand Down

0 comments on commit 6c1206d

Please sign in to comment.