-
Notifications
You must be signed in to change notification settings - Fork 38
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
Implement Sink for Sender #12
Comments
This could be easily implemented. I think my main hesitation is that the Sink trait is not very popular and my impression is that its future is uncertain. But maybe it doesn’t matter. Adding a Sink impl probably doesn’t hurt - it can only make things better. cc @yoshuawuyts do you perhaps have an opinion on this? |
I don't particularly like the I would like to recommend that if we add edit (2020-08-24): A good post on sinks vs iterators in C++ was posted by a WG21 member; I think the issues raised translate to Future Sinks vs async Iteration in Rust as well (link). |
There is a |
I had a look at the
So I don't really feel confident proposing a PR on code I don't quite understand. Also the |
I would propose to add an adapter to consume a Stream, like: Would that help? |
@stsydow I don't think that helps when you need an interface. That is if you want to pass the channel to something that takes a |
I proposed it as |
I personally don't like how Sink works either, but until we propose something better, it's the interface we have and most async projects will have the futures lib in their deps anyway, so it doesn't add to much strain. Some discussion was started here, but it hasn't seem much action. |
Is there any movement here? I have a project that takes |
Hi from the future. In the future we still have Futures, and Sink is alive and well.
|
The
futures
crate contains aSink
trait. This trait allows for a convenient interaction between its implementors and streams using theforward
method on theStreamExt
trait.So I think implementing
Sink
forSender
would improve the ergonomics of the library.The text was updated successfully, but these errors were encountered: