Skip to content

refactor: replace asyncio.gather with asyncio.wait for better task lifecycle management#288

Open
battlecook wants to merge 1 commit intokyutai-labs:mainfrom
battlecook:refactor/replace-gather-with-wait
Open

refactor: replace asyncio.gather with asyncio.wait for better task lifecycle management#288
battlecook wants to merge 1 commit intokyutai-labs:mainfrom
battlecook:refactor/replace-gather-with-wait

Conversation

@battlecook
Copy link

Checklist

  • Read CONTRIBUTING.md, and accept the CLA by including the provided snippet. We will not accept PR without this.
  • Run pre-commit hook.
  • If you changed Rust code, run cargo check, cargo clippy, cargo test.

PR Description

refactor: replace asyncio.gather with asyncio.wait for better task lifecycle management

  • Replace asyncio.gather() with asyncio.wait(return_when=FIRST_COMPLETED) in both server and client

Files changed:

  • moshi/server.py: Update handle_chat method's task management
  • moshi/client.py: Update Connection.run method's task management

CLA
I, battlecook, confirm that I have read and understood the terms of the CLA of Kyutai-labs, as outlined in the repository's CONTRIBUTING.md, and I agree to be bound by these terms.

…fecycle management

- Replace asyncio.gather() with asyncio.wait(return_when=FIRST_COMPLETED) in both server and client

Files changed:
- moshi/server.py: Update handle_chat method's task management
- moshi/client.py: Update Connection.run method's task management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant