-
Notifications
You must be signed in to change notification settings - Fork 221
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 methods on WebSocket to better implement Sink::poll_ready #342
Conversation
That looks like an interesting idea. I'll try to review it in more detail and check for regressions over the holidays. As for the naming, I think instead of Not quite sure about
|
|
That's right. What I mean is that we need at least the following functions to fully cope with the semantics in
Currently, Ideally we want to split them so that we have separate methods for each of these stages to utilise it from |
If I copy you right, |
Totally agree on
|
This looks somewhat related to the PRs I raised recently. I propose we
|
Indeed, then I think I'll close it. |
I noticed in
tokio-tungstenite
that Sink isn't quite implemented as it should be -poll_ready
actually flushes the sink, andstart_send
has the possibility to do some IO. This adds methods,write_pending_ready
andsubmit_message
that can be used to implement those more correctly.I wasn't sure whether to have
write_pending_ready
check forAlreadyClosed
andSendAfterClosing
, but went with it because I feel like that's whatpoll_ready
would want. Also I'm incredibly unsure about naming for these, please suggest better ones (especiallywrite_pending_ready
).