6 ms·
Streamed-response use cases get weird/complicated if you have to return the response.
by alectic 4y ago
Streamed-response use cases get weird/complicated if you have to return the response.
- masklinn 4y agoSure but is that the usual / default? Why not have a second adapter?
- deathanatos 4y agoNot 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.)