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

Improved streamable body implementation. #67

Merged
merged 13 commits into from
Sep 9, 2024
Merged

Improved streamable body implementation. #67

merged 13 commits into from
Sep 9, 2024

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Sep 7, 2024

Bi-directional streaming is important for things like WebSockets, especially considering that we want to keep the WebSocket client and server as efficient as possible.

Streamable bodies use the stream? -> true escape hatch which reduces the complexity of supporting bi-directional streaming clients and servers.

I have a strong desire to remove this feature as the complexity is only slightly outweighed by the benefits. As an interface, it's strictly worse IMHO. In essence, the streaming interface has distinctly different requirements on the client and server side (see #stream(input) on the client side).

As an alternative, maybe we can remove "Streamable" as a concept and instead introduce some kind of hijack! mechanism for the request and response side of the connection handling. This mechanism only applies to HTTP/1 in general.

Types of Changes

  • Bug fix.
  • New feature.
  • Breaking change.

Contribution

@ioquatix
Copy link
Member Author

ioquatix commented Sep 9, 2024

This needs to be merged along with changes to async-http, further changes will be required after that.

@ioquatix ioquatix merged commit 0bb3b0a into main Sep 9, 2024
24 of 40 checks passed
@ioquatix ioquatix deleted the body-streaming branch September 9, 2024 21:08
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

Successfully merging this pull request may close these issues.

1 participant