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 support for unidirectional NIOPipeBootstrap
#2560
Add support for unidirectional NIOPipeBootstrap
#2560
Conversation
Oh @FranzBusch let's also fix |
f90a36b
to
1748c4e
Compare
4172d79
to
55cae0a
Compare
@@ -22,7 +22,6 @@ internal struct OutputGrepper { | |||
|
|||
internal static func make(group: EventLoopGroup) -> OutputGrepper { | |||
let processToChannel = Pipe() | |||
let deadPipe = Pipe() // just so we have an output... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with weissi that we should drop the "s". I left a bunch of doc nits too... Otherwise looks good.
fde39a7
to
0e4ce99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left the same doc nit a bunch of times but also a bit confused by some of the naming... would be good to clear that up. Looks good otherwise!
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) | ||
func _takingOwnershipOfDescriptors<ChannelInitializerResult, PostRegistrationTransformationResult: Sendable>( | ||
public func takingOwnershipOfDescriptor<Output: Sendable>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output
is a bit misleading in light of input
/output
descriptors. Should we use "Result" or something super-generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using Output
in all the other methods some I am hesitant to change it just for this one. Also why do you suggest making this public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using
Output
in all the other methods some I am hesitant to change it just for this one.
Yeah, I get that, it's probably fine as is.
Also why do you suggest making this public?
I didn't, you made it public!
0e4ce99
to
834cc75
Compare
# Motivation In some scenarios, it is useful to only have either an input or output side for a `PipeChannel`. This fixes apple#2444. # Modification This PR adds new methods to `NIOPipeBootstrap` that make either the input or the output optional. Furthermore, I am intentionally breaking the API for the new async methods since those haven't shipped yet to reflect the same API there. # Result It is now possible to bootstrap a `PipeChannel` with either the input or output side closed.
834cc75
to
2a59e2d
Compare
Motivation
In some scenarios, it is useful to only have either an input or output side for a
PipeChannel
. This fixes #2444.Modification
This PR adds new methods to
NIOPipeBootstrap
that make either the input or the output optional. Furthermore, I am intentionally breaking the API for the new async methods since those haven't shipped yet to reflect the same API there.Result
It is now possible to bootstrap a
PipeChannel
with either the input or output side closed.