News for hackers. Stuff that matters.
Re:The problem with Go’s default HTTP handlers by alectic on Tuesday August 09, 2022 @12:31PM (#32400170)
Streamed-response use cases get weird/complicated if you have to return the response.
Re:The problem with Go’s default HTTP handlers by deathanatos on Tuesday August 09, 2022 @01:33PM (#32401051)
Not necessarily? The type used for Response can include a "body" type that supports streaming. E.g., body: AsyncRead in Rust. In Go I think it would resemble a channel that emitted the contents of the body.

(As a library, though, you'd also want to make the simple non-streaming case of "just return this blob of bytes" simple for the consumer, too.)

Re:The problem with Go’s default HTTP handlers by masklinn on Tuesday August 09, 2022 @12:41PM (#32400298)
Sure but is that the usual / default? Why not have a second adapter?