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

support stream resets through user events #488

Closed
wants to merge 1 commit into from

Conversation

ehaydenr
Copy link
Contributor

Resetting streams with specific error codes is required by some applications such as those implementing the CONNECT method (see https://datatracker.ietf.org/doc/html/rfc9113#section-8.5-8). ChannelOutboundInvoker.close doesn't allow for closing channels while specifying an error code. To get around this, this change defines an event HTTP2StreamChannelEvent which allows applications to close the channel with additional detail.

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Dec 16, 2024
@@ -998,3 +1007,9 @@ extension HTTP2StreamChannel {
SynchronousOptions(channel: self)
}
}

/// Events that can be sent by the application to be handled by the `HTTP2StreamChannel`
public enum HTTP2StreamChannelEvent {
Copy link
Contributor

Choose a reason for hiding this comment

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

So I think we'll probably end up regressing making this a public enum, as we can't easily evolve that as an API. I think we should store the "real" value in an enum, but have this wrapped in a struct that has a few static func constructors..

We'll also need tests for this.

@ehaydenr
Copy link
Contributor Author

closing in favor of apple/swift-nio-extras#241

@ehaydenr ehaydenr closed this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants