-
Notifications
You must be signed in to change notification settings - Fork 84
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 a variant of configureAsyncHTTPServerPipeline
which takes a stream delegate
#471
Add a variant of configureAsyncHTTPServerPipeline
which takes a stream delegate
#471
Conversation
/// be waited on to retrieve the result of the negotiation. | ||
@inlinable | ||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | ||
public func configureAsyncHTTPServerPipeline<HTTP1ConnectionOutput: Sendable, HTTP2ConnectionOutput: Sendable, HTTP2StreamOutput: 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.
Hi @adam-fowler, can you write a quick test that actually uses this function? Doesn't need to be complex, just something to confirm that it works and to ensure we won't regress it.
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.
whoops forgot to do that
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.
done
I've found I can't configure the HTTP1 channel either now. Would it be easier to make |
I'd like @FranzBusch to weigh in here if that's ok. |
In general, I am not opposed to making that method |
Actually you are right there, I can implement Regarding the function I am adding here if the user wanted to configure the HTTP1 channel, it would require adding a bunch more parameters to this function ie all the parameters that |
So I got around this by duplicating |
I'm inclined to still want to take something in this space. @glbrntt was the last to work in this area of the codebase and so probably has the most informed opinion. |
Well from my point of view making
Which isn't far from the EventLoop API channel.configureHTTP2SecureUpgrade(
h2ChannelConfigurator: { channel in
setupHTTP2Channel()
},
http1ChannelConfigurator: { channel in
setupHTTP1Channel()
}
) |
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 think this makes sense to add, but can you de-dupe some of the code with the other helper?
5372cfd
to
bc8c387
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.
Looks great, thanks a lot Adam!
There are a couple of formatting bits that need fixing up:
|
@glbrntt seems like some of the actions failed because of timeouts when setting up |
In the async HTTP2 pipeline there is no way to account for the opening and closing of streams. This PR adds a variant of
configureAsyncHTTPServerPipeline
(HTTP2 upgrade channel) that allows the user to pass in aNIOHTTP2StreamDelegate
to be applied to the HTTP2 channel if the upgrade occurs.This is similar to #439 which did the same HTTP2 only channels.