-
Notifications
You must be signed in to change notification settings - Fork 0
Add a RequestContext to the request handler #26
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
Conversation
| public protocol HTTPRequestContext: Sendable { | ||
|
|
||
| } | ||
|
|
||
|
|
||
| public struct HTTPServerRequestContext: HTTPRequestContext { |
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.
Does it need to be a protocol and can we add some docs?
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.
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.
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.
Type names could definitely be improved but I was thinking the concrete implementation would be NIO's context.
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 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
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.
Okay yeah that makes sense to match gRPC. I've redone this - what do you think now?
# Conflicts: # Sources/HTTPServer/HTTPServerClosureRequestHandler.swift # Sources/HTTPServer/HTTPServerProtocol.swift # Sources/HTTPServer/HTTPServerRequestHandler.swift
2767e7e to
361a624
Compare
No description provided.