-
Notifications
You must be signed in to change notification settings - Fork 100
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
Should raw low-level request handlers provide a Writer? #14
Comments
Curious what @prashantv and @akshayjshah have to say here. |
I'm a little biased since I suggested this in a code review. The HTTP ResponseWriter buffers already, as does TChannel (it writes into a frame, and then sends that frame). Since the underlying layers already buffers, if we introduce another buffer in our transport layer, we're doing 2x the buffering, and (possibly more importantly) twice the memory allocations. While I'm not too concerned about performance currently, this kind of change is would break the design / API so I want to make sure we think about this now rather than later. |
True. Another reason I'm seriously considering it is this: For Thrift (and other encoders) will all have some sort of |
I'm all in favor of this. Even if we're not worried about performance, using an |
FWIW this won't affect the public API for JSON and Thrift but it will affect the public API for raw-low level usage (streams of raw bytes, forwarding servers, or implementing your own encoding). |
🍔 🍔 foot-shooty 🍔 🍔 |
We could have the low-level handler provide a ResponseWriter (similar to http's ResponseWriter) which will let us skip the
io.Copy
we have to do from the responseReader
to thehttp.ResponseWriter
.The text was updated successfully, but these errors were encountered: