-
Notifications
You must be signed in to change notification settings - Fork 18
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
WriteChunk API for HTTP1 #220
Conversation
@@ -3,7 +3,7 @@ | |||
import AwsCHttp | |||
import Foundation | |||
|
|||
/// An base class that represents a single Http Request/Response for both HTTP/1.1 and HTTP/2. | |||
/// An base abstract class that represents a single Http Request/Response for both HTTP/1.1 and HTTP/2. | |||
/// Can be used to update the Window size, and get status code. | |||
public class HTTPStream { |
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 thought about turning this class into a protocol to avoid the abstract class workaround with fatalAssert
, but that would require making rawValue
and callbackData
variables public.
|
||
|
||
/// This method must be overriden in each subclass. | ||
public func writeChunk(chunk: Data, endOfStream: Bool) async throws { |
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.
mildly annoyed by calling this "chunk"
"chunk" is an HTTP/1-specific term
@@ -41,7 +41,12 @@ public class HTTPStream { | |||
throw CommonRunTimeError.crtError(.makeFromLastError()) | |||
} | |||
} | |||
|
|||
|
|||
/// This method must be overriden in each subclass. |
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.
is this how interface functions are supposed to be documented? doesn't seem very useful to the user
Should this document how you have to set up the connection with "use manual data writes" or "transfer-encoding: chunked" depending on whether it's HTTP/1 or HTTP/2?
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 have updated the documentation to link to the H1 and H2 documentation.
Issue #, if available:
#218
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.