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

std::io::pipe needs to be useful #13538

Closed
alexcrichton opened this issue Apr 15, 2014 · 3 comments
Closed

std::io::pipe needs to be useful #13538

alexcrichton opened this issue Apr 15, 2014 · 3 comments
Labels
P-low Low priority

Comments

@alexcrichton
Copy link
Member

Currently this module supports consuming a file descriptor to make an I/O object, but it provides no method of creating the file descriptor itself. The current usage of the module is essentially tailored for whatever std::io::process needed to get implemented. Some things I believe need to improve:

  • Is PipeStream the right name?
  • PipeStream should be constructable with a function that takes no arguments
  • Should the underlying file descriptor be exposed through a method?

I'm nominating this, but I don't view this as a super-critical piece of infrastructure. My current feeling is that it's "good as is" except for the name PipeStream which I can learn to live with. The other extra methods can be added later. That being said, this module needs a close look to ensure there's nothing backwards incompatible we'll want to live with.

@eddyb
Copy link
Member

eddyb commented Apr 16, 2014

I think MemoryMap has the same file descriptor issue.

@pnkfelix
Copy link
Member

Marking P-low, not 1.0 issue.

alexcrichton added a commit that referenced this issue Jun 16, 2014
* os::pipe() now returns IoResult<os::Pipe>
* os::pipe() is now unsafe because it does not arrange for deallocation of file
  descriptors
* os::Pipe fields are renamed from input to reader and out to write.
* PipeStream::pair() has been added. This is a safe method to get a pair of
  pipes.
* Dealing with pipes in native process bindings have been improved to be more
  robust in the face of failure and intermittent errors. This converts a few
  fail!() situations to Err situations.

Closes #9458
cc #13538
Closes #14724
[breaking-change]
bors added a commit that referenced this issue Jun 16, 2014
* os::pipe() now returns `IoResult<os::Pipe>`
* os::pipe() is now unsafe because it does not arrange for deallocation of file
  descriptors
* PipeStream::pair() has been added. This is a safe method to get a pair of
  pipes.
* Dealing with pipes in native process bindings have been improved to be more
  robust in the face of failure and intermittent errors. This converts a few
  fail!() situations to Err situations.

cc #13538
Closes #14724
[breaking-change]
@alexcrichton
Copy link
Member Author

old_io is on its way out (and not being replaced), so I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-low Low priority
Projects
None yet
Development

No branches or pull requests

3 participants