Skip to content

Sending stream responses (experimental) #1327

@pi0

Description

@pi0

Moving from (#19)

Coming with [email protected] and new event.handled flag it is possible to take over h3 response mechanism and send streams. For Workers, we can check res._body property existence. Direct fetch in unenv (src) passes the body as is.

This way we can implement sendStream with the minimum possible changes. Once tested enough and working for common presets, I plan to add this as a built-in (nitro/h3) utility.

Example usage: https://github.com/unjs/nitro-deploys/blob/main/routes/stream.ts

Working deployments:

Screen.Recording.2023-06-21.at.02.56.44.mov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions