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

Transfer the payloads using streams #38

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Transfer the payloads using streams #38

wants to merge 12 commits into from

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented Dec 3, 2024

This PR adds the ability to stream a response across threads (instead of collecting and dispatching the full body). This is needed to fully support Next.js streaming as well as big bodies incoming/outgoing.

This behavior requires two more full event loop turns (two postMessage calls in the minimum case), so this is limited to big (arbitrarly over 32 KB) or streamed (no content-length header) responses.

This is needed to support large payloads.

Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
@mcollina mcollina marked this pull request as ready for review December 19, 2024 17:58
Copy link
Collaborator

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM given you take care of all TODOs you left.

Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
Signed-off-by: Matteo Collina <[email protected]>
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.

2 participants