-
Notifications
You must be signed in to change notification settings - Fork 653
Add Sink01As03 compat shim #1364
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
Conversation
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.
@Nemo157 should be ready for another look.
@Nemo157 do we want to still move this forward, I know you might be busy so no need to rush but want to make sure this isn't getting too far out of sync if there still is a need for it. |
Sorry, I managed to completely forget about this 😦 I skimmed the latest changes, and they look good at first glance. That's a deep match though, so I will try to read it a bit more thoroughly this weekend. |
@Nemo157 no worries! I am still around to finish this up, I will address the one comment left, see if I can ease up that match, and rebase against master. |
@Nemo157 sorry for the delay, I've cleaned up the poll_close logic and tested it. All seems like its good to go. Thanks. |
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.
LGTM
Great job! There is a slight inconsistency: Usually |
I think this may need a rebase because of the I'd love to see this merged since it's currently a pain to work with websockets without being able to send to them. I ended up using a copy of this PR in my code which works fine so far, but official support for sinks would be great. |
I’m keen to merge it, but don’t have a commit bit. @cramertj is the only active merger as far as I’m aware (maybe it’s worth spreading that responsibility a bit?). |
I'm watching and would be happy to merge when this is ready! @Nemo157 we should definitely get you added to the list-- I'll see what I can do about that. |
sounds good, give me a few and ill fix conflict issues. |
@Nemo157 done! you should have merge rights now. |
This adds a compat shim to go from a 0.1 Sink to a 0.3 Sink. This follows, roughly how the stream compat works with the exception that it stores an internal buffer of one item. This is due to the fact that there is no `LocalWaker` passed to `Sink01::start_send`, so we can only actually write the item in the sink on the next `Sink03::poll_read` which gets a `LocalWaker`.
Thanks for this 😄 I should have time in a couple days to update the compat blog post with these changes and finally get that merged. |
This adds a compat shim to go from a 0.1 Sink to a 0.3 Sink. This follows, roughly how the stream compat works with the exception that it stores an internal buffer of one item. This is due to the fact that there is no
LocalWaker
passed toSink01::start_send
, so we can only actually write the item in the sink on the nextSink03::poll_read
which gets aLocalWaker
.This PR is related to #1362 and cc @Nemo157.