-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[replit_river] return cleanup task from client.disconnect() (#99)
Why === * The task created by the websocket wrapper was orphaned. Tasks need to be awaited somewhere, or you get errors like ``` RuntimeError: no running event loop Task was destroyed but it is pending! ``` * Since it takes a while to finish, we don't want to wait for it in certain cases, so instead we'll return it as a cleanup task that the caller can await as appropriate. What changed === * When the websocket close task is made, return it. * At every level, return the task and combine it with other cleanup tasks as appropriate Test plan === * The behavior shouldn't be different unless you await the cleanup function. If you do await it, you won't get a pending task exception when closing the event loop.
- Loading branch information
Showing
5 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters