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 unix::pipe #1356

Merged
merged 10 commits into from
Oct 24, 2020
Merged

Add unix::pipe #1356

merged 10 commits into from
Oct 24, 2020

Conversation

Thomasdezeeuw
Copy link
Collaborator

Adds one new function: unix::pipe, which is a wrapper around the pipe(2)
system call, and two new types: Sender and Receiver, wrappers around the
file descriptors.

This is a port of https://github.com/Thomasdezeeuw/mio-pipe, commit
8c3025edf128e90733e95327d88493887b93fcdd.

Closes #1354.

@Thomasdezeeuw
Copy link
Collaborator Author

This adds 189 lines of code (381 total) in sys::unix, and ~200 lines of test code.

@Thomasdezeeuw
Copy link
Collaborator Author

These feature matrices are getting out hand.. we're up to 65 (!) combinations now.

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I did have a thought re: the handle names.

src/lib.rs Outdated Show resolved Hide resolved
Adds one new function: unix::pipe, which is a wrapper around the pipe(2)
system call, and two new types: Sender and Receiver, wrappers around the
file descriptors.

This is a port of https://github.com/Thomasdezeeuw/mio-pipe, commit
8c3025edf128e90733e95327d88493887b93fcdd.
Currently we support 1.39 as minimum version, the `matches!` macro it's
suggesting has only been stable since 1.42.
Before it would only do so when one of the net feature was enabled, but
the pipe feature also uses it.
This isn't yet available on stable, but it is complaining on nightly.
Exporting pipe::Sender, pipe::Receiver and pipe::new, removing
unix::Sender, unix::Receiver and unix::pipe.
@carllerche carllerche merged commit 2b7c096 into tokio-rs:master Oct 24, 2020
@Thomasdezeeuw Thomasdezeeuw deleted the mio-pipe branch October 24, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: move Mio-pipe into Mio
2 participants