Skip to content

refactor: {Read,Write}Message return errors without closing connection#68

Merged
mccutchen merged 11 commits intomainfrom
no-close-on-error
Oct 26, 2025
Merged

refactor: {Read,Write}Message return errors without closing connection#68
mccutchen merged 11 commits intomainfrom
no-close-on-error

Conversation

@mccutchen
Copy link
Owner

The idea here is:

  • Use the Serve() method for a high-level API that will automatically close the connection when errors are encountered
  • Use the ReadMessage()/WriteMessage()/CloseWithStatus() methods to have more control over connection lifecycle, including the decision about when a read or write error should close the connection

I think this improves the API by making it more explicit, and also simplifies some tests.

@github-actions
Copy link

github-actions bot commented Oct 26, 2025

🔥 Run benchmarks comparing c135432 against main:

gh workflow run bench.yaml -f pr_number=68

Note: this comment will update with each new commit.

@mccutchen mccutchen changed the title refactor: ReadMessage and WriteMessage return errors without closing connection refactor: {Read,Write}Message return errors without closing connection Oct 26, 2025
@codecov
Copy link

codecov bot commented Oct 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.11%. Comparing base (8744466) to head (c135432).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
+ Coverage   96.99%   98.11%   +1.12%     
==========================================
  Files           2        2              
  Lines         432      425       -7     
==========================================
- Hits          419      417       -2     
+ Misses          7        4       -3     
+ Partials        6        4       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mccutchen mccutchen merged commit 912ea1b into main Oct 26, 2025
13 checks passed
@mccutchen mccutchen deleted the no-close-on-error branch October 26, 2025 11:04
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