-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new send_frame method to WebSockets #9348
Conversation
Currently there is no way to send TEXT frames when the source data is a UTF-8 encoded bytes object without having decode the bytes to string before passing it to `send_str`, and than having the WebSocket internals encode it back to `bytes`. When sending at volume, the extra decode/encode cycle is a significant bottleneck.
Thanks for the review |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #9348 +/- ##
=======================================
Coverage 98.55% 98.56%
=======================================
Files 107 107
Lines 34915 34949 +34
Branches 4138 4139 +1
=======================================
+ Hits 34412 34446 +34
Misses 335 335
Partials 168 168
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport to 3.11: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 2628256 on top of patchback/backports/3.11/2628256c0a4bea74b9fec9169c7fbefe622fcac1/pr-9348 Backporting merged PR #9348 into master
🤖 @patchback |
(cherry picked from commit 2628256)
What do these changes do?
Currently there is no way to send TEXT frames when the source data is a UTF-8 encoded bytes object without having decode the bytes to string before passing it to
send_str
, and than having the WebSocket internals encode it back tobytes
. When sending at volume, the extra decode/encode cycle is a significant bottleneck.Are there changes in behavior for the user?
no
Is it a substantial burden for the maintainers to support this?
no