Skip to content

Commit

Permalink
Add run_async function
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekuruu committed Mar 14, 2024
1 parent 1059b8f commit 14f12b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions osu/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ def run(self, retry=False, exit_on_interrupt=False) -> None:
if exit_on_interrupt:
exit(0)

async def run_async(self) -> None:
"""Run the game in an async context"""
import asyncio

loop = asyncio.get_event_loop()
await loop.run_in_executor(None, self.run, False, False)

def fetch_version(self, stream: str = "stable40") -> Optional[str]:
"""
Fetch the latest version of the client from:
Expand Down

0 comments on commit 14f12b8

Please sign in to comment.