Skip to content

Conversation

@gjcairo
Copy link
Collaborator

@gjcairo gjcairo commented Nov 18, 2025

No description provided.

@gjcairo gjcairo requested a review from FranzBusch November 19, 2025 14:47
Comment on lines 1 to 6
public protocol HTTPRequestContext: Sendable {

}


public struct HTTPServerRequestContext: HTTPRequestContext {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need to be a protocol and can we add some docs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops, forgot to push the docs.

I thought it would make sense so different implementations can add their own stuff to it, like say for NIO it could expose the stream channel or some other implementation specific information.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Type names could definitely be improved but I was thinking the concrete implementation would be NIO's context.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be a concrete type really and then this type might hold a transport specific existential honestly. Introducing another generic parameter isn't going to make it easier :D Also we don't need the transport existential yet we can add it later. This is similar to what gRPC is doing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay yeah that makes sense to match gRPC. I've redone this - what do you think now?

@gjcairo gjcairo requested a review from FranzBusch November 20, 2025 16:41
# Conflicts:
#	Sources/HTTPServer/HTTPServerClosureRequestHandler.swift
#	Sources/HTTPServer/HTTPServerProtocol.swift
#	Sources/HTTPServer/HTTPServerRequestHandler.swift
@gjcairo gjcairo merged commit b5cacb9 into main Nov 26, 2025
4 of 18 checks passed
@gjcairo gjcairo deleted the request-context branch November 26, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants