-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update tokio-tungstenite 0.20 #2116
Conversation
axum/src/extract/ws.rs
Outdated
/// Does nothing, instead use `max_write_buffer_size`. | ||
#[deprecated] | ||
pub fn max_send_queue(self, _: usize) -> Self { | ||
self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You say it’s deprecated upstream but that should mean we can still call it right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can. However, upstream it does absolutely nothing since the send-queue concept was removed.
The field was kept & deprecated to smoothen the churn. It should be removed with the next tungstenite breaking change.
So with no reason to set it, we can just deprecate and have the method do nothing (which also even more clearly demonstrates that it does nothing to axum users). Or as a breaking change remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My 2c: Merge deprecation into v0.6.x
(and do another point release when releasing 0.7, if not sooner), remove on main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me!
@alexheretic do you wanna change this PR to include the breaking changes and make another one into the v0.6.x
branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I raised #2123 with the non-breaking update to v0.6.x
.
Deprecate WebSocketUpgrade::max_send_queue Add WebSocketUpgrade::write_buffer_size, max_write_buffer_size
a7b929f
to
f4abd0d
Compare
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Motivation
More optimal websocket
SinkExt::feed
performance by using recent upstream versions with better flushing behaviour.Solution
0.20
. See changelog, tungstenite changelog.WebSocketUpgrade::max_send_queue
.WebSocketUpgrade::write_buffer_size
,max_write_buffer_size
(new upstream).Note: I added all upstream docs, feel free to trim them down if you prefer.