Skip to content

Support streaming body contents#9

Open
ranfdev wants to merge 2 commits intojoy-framework:masterfrom
ranfdev:master
Open

Support streaming body contents#9
ranfdev wants to merge 2 commits intojoy-framework:masterfrom
ranfdev:master

Conversation

@ranfdev
Copy link
Copy Markdown

@ranfdev ranfdev commented Sep 17, 2025

Users can now set the :body field to a fiber, so that the server will stream the values yielded by the fiber as body.

This enables returning Server Sent Events, which is a one directional way to send events to clients. It's a simpler solution for realtime communication, instead of using websockets.

I needed to use SSEs with the library htmx

Also, now returning a response with an invalid body (such as a table) will properly return "Internal server error", instead of just crashing the fiber handling the connection

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