-
Notifications
You must be signed in to change notification settings - Fork 9
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
don't stream certain in-memory io.Readers #44
Conversation
Marked this as a draft because I'm not 100% convinced we definitely want to do this, but it's the implementation following my comment in #38 (comment). |
One possible other adjustment would be to actually examine the size of the buffers (all three types implement |
cbaa269
to
48a9ed1
Compare
I decided not to limit it based on length because the Rust SDK doesn't do anything like that currently. (It implements the |
Moving back to draft, as this needs some work. |
`bytes.Buffer`, `bytes.Reader`, and `strings.Reader` are all `io.Reader` implementions on an in-memory buffer. Their sizes are known ahead of time, and these types tend to be used for small payloads. We can copy these payloads into an `fsthttp.Body` and send them with a `Content-Length` header rather than using chunked encoding by sending them with `SendAsync` rather than `SendAsyncStreaming`.
2e3451c
to
f5340a7
Compare
bytes.Buffer
,bytes.Reader
, andstrings.Reader
are allio.Reader
implementations on an in-memory buffer. Their sizes are known ahead of
time, and these types tend to be used for small payloads. We can send
these payloads with a
Content-Length
rather than using chunkedencoding by sending them with
SendAsync
rather thanSendAsyncStreaming
.