Skip to content
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

Switch Request.body to a Stream-like type #3

Open
chuwy opened this issue Dec 15, 2023 · 1 comment
Open

Switch Request.body to a Stream-like type #3

chuwy opened this issue Dec 15, 2023 · 1 comment

Comments

@chuwy
Copy link
Contributor

chuwy commented Dec 15, 2023

Currently its String which means every time request is sent or received - we load the whole body into memory, which:

  1. Might be unnecessary - in some cases we know we don't need the body based on request metadata
  2. Blocking and takes up a lot of memory - if the request is 1Gb - it will be loaded into memory
  3. Might not be a string, but a blob

There's IO.FS.Stream, but I'm not sure how good it fits.

@chuwy
Copy link
Contributor Author

chuwy commented Dec 15, 2023

In worst case it can be IO ByteArray I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant