Skip to content
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 SimplexStream structure #6589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wutchzone
Copy link
Contributor

I think that it is unfortunate that the underlying structure backing the DuplexStream is not exposed. There are cases where a single direction will suffice, for example, when I have only a single writer and single reader, thus not requiring bidirectionality.

In this patch, I renamed the Pipe to the SimplexStream for coherence with the already existing DuplexStream and made it public

Up until this patch we had the `DuplexStream` which was backed by
two underlying pipes. This patch makes public this underlying structure
and renames it from the `Pipe` to the `SimplexStream` to provent
name confusion and keep simililiarity with the already existing duplex.
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-io Module: tokio/io labels May 26, 2024
@Darksonn
Copy link
Contributor

Adding a stream with one direction of communication seems reasonable, but I don't love the name SimplexStream. Maybe it's the best option, but can we come up with anything else? I guess there's the option of just keeping Pipe ...

@wutchzone
Copy link
Contributor Author

My reasoning for not using Pipe is that it is already an overloaded term used for OS primitive, and someone could get confused by reusing it again. And since we have the DuplexStream I think™ that a better name is SimplexStream because these two structures are somewhat related.

But if you think it is negligible I will change it back to the Pipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants