Raise TimeoutError instead of queue.Empty in WebSocketSession#139
Merged
frankie567 merged 2 commits intomainfrom Mar 28, 2026
Merged
Raise TimeoutError instead of queue.Empty in WebSocketSession#139frankie567 merged 2 commits intomainfrom
TimeoutError instead of queue.Empty in WebSocketSession#139frankie567 merged 2 commits intomainfrom
Conversation
Agent-Logs-Url: https://github.com/frankie567/httpx-ws/sessions/41d5738b-5a35-4def-92cb-0f3b09736ded Co-authored-by: frankie567 <1144727+frankie567@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Raise TimeoutError instead of queue.Empty in WebSocketSession
Raise Mar 28, 2026
TimeoutError instead of queue.Empty in WebSocketSession
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
==========================================
- Coverage 99.83% 99.51% -0.33%
==========================================
Files 5 5
Lines 612 615 +3
==========================================
+ Hits 611 612 +1
- Misses 1 3 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
davidbrochart
approved these changes
Mar 28, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebSocketSession.receive()(and derived methods) leakedqueue.Emptyon timeout — an internal implementation detail.AsyncWebSocketSessionalready raisesTimeoutErrorviaanyio.fail_after(), so sync and async APIs were inconsistent.Changes
WebSocketSession.receive(): Catchesqueue.Emptyfromqueue.Queue.get()and re-raises asTimeoutErrorreceive(),receive_text(),receive_bytes(),receive_json()to documentTimeoutErrorinstead ofqueue.Emptytest_receive_timeoutcovering the new behaviourBefore / After
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.