For unknown reasons, the KeepAliveHandler was a thread, which just sleeps and does run_coroutine_threadsafe, which seemed kinda dumb to me. This is also the reason for a thread per voice channel, as KeepAliveHandler was subclassed for VoiceKeepAliveHandler.
This PR turns the thread into an asyncio.Task, and just uses asyncio.wait_for and await for the calls.
Checklist
If code changes were made then they have been tested.
I have updated the documentation to reflect the changes.
This PR fixes an issue.
This PR adds something new (e.g. new method or parameters).
This PR is a breaking change (e.g. methods or parameters removed/renamed)
This PR is not a code change (e.g. documentation, README, ...)
<!-- Pull requests that do not fill this information in will likely be closed -->
## Summary
<!-- What is this pull request for? Does it fix any issues? -->
For unknown reasons, the `KeepAliveHandler` was a thread, which just sleeps and does `run_coroutine_threadsafe`, which seemed kinda dumb to me. This is also the reason for a thread per voice channel, as `KeepAliveHandler` was subclassed for `VoiceKeepAliveHandler`.
This PR turns the thread into an `asyncio.Task`, and just uses `asyncio.wait_for` and `await` for the calls.
## Checklist
<!-- Put an x inside [ ] to check it, like so: [x] -->
- [x] If code changes were made then they have been tested.
- [ ] I have updated the documentation to reflect the changes.
- [ ] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is **not** a code change (e.g. documentation, README, ...)
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
For unknown reasons, the
KeepAliveHandlerwas a thread, which just sleeps and doesrun_coroutine_threadsafe, which seemed kinda dumb to me. This is also the reason for a thread per voice channel, asKeepAliveHandlerwas subclassed forVoiceKeepAliveHandler.This PR turns the thread into an
asyncio.Task, and just usesasyncio.wait_forandawaitfor the calls.Checklist
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.