Skip to content

Should we somehow expose Pipe*Stream on Unix, and if so, how? #829

@njsmith

Description

@njsmith

We have PipeReceiveStream and PipeSendStream classes on Unix, that are currently not exposed publicly; they're only used internally for subprocesses.

The actual code is a pretty generic building block: they can wrap around any Unix file-descriptor that supports non-blocking mode. So they could potentially be useful for talking to FIFOs, TTYs, stdio streams (#174), etc.

Should we expose them more directly? If so, how? In trio.hazmat, with some sort of os.fdopen equivalent?

If we do we'll want to think through the ownership semantics: should they take ownership of a passed in fd, or should they dup it?

Also, they should restore the fd's blocking/non-blocking state before closing it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions