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

Make request/response bodies an async sequence of bytes #9

Assignees
Labels
area/generator Affects: plugin, CLI, config file. area/runtime Affects: the runtime library. area/transport Affects: Client or server transport library. kind/enhancement Improvements to existing feature. size/L Large task. (A couple of weeks of work.)
Milestone

Comments

@czechboy0
Copy link
Contributor

For simplicity, initially the type holding the raw request and response body data is Foundation.Data, but that prevents use cases where large amounts of data need to be sent/received if the memory limit of the process is low.

What should be possible: a uploading/downloading large (multi-GB) files without buffering them into memory on either client/server ends.

@czechboy0 czechboy0 added ⚠️ semver/major Breaks existing public API. area/generator Affects: plugin, CLI, config file. area/runtime Affects: the runtime library. area/transport Affects: Client or server transport library. status/needs-design Needs further discussion and a concrete proposal. kind/enhancement Improvements to existing feature. size/L Large task. (A couple of weeks of work.) labels May 25, 2023
@FranzBusch
Copy link
Member

This is an important topic to cover and something that we are currently discussing in the broader ecosystem. The SSWG is currently gathering requirements for a general purpose HTTP server. One of the key functionalities of this new type is support for full bidirectional streaming.
I think we should follow the API design of the general purpose HTTP server here in OpenAPI.

@czechboy0
Copy link
Contributor Author

czechboy0 commented Aug 18, 2023

We might need to provide an async body not just for raw byte content types, but also for text/*, as text/event-stream would need that to work.

Either we'll exclude text/event-stream from being returned as String, or we'll need to provide AsyncSequence for text bodies. For more see #207.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment