Skip to content

Action function stream response #8695

Closed Answered by admirsaheta
rreeves8 asked this question in Q&A
Discussion options

You must be logged in to vote

Streaming text data from an action function can get tricky, Remix doesn't have built-in functionality for it. But, we can still make it work!

Might be https://remix.run/docs/en/main/guides/streaming

WebSockets are best for real-time, back-and-forth communication. For pushing data from server to client, SSE or Action Data Chunking could work depending on your needs.

Action Data Chunking isn't true streaming, but it can feel similar. We'd break down your data into smaller portions. In your action function, process the data chunk by chunk. After each chunk is done, you'd return an object containing the processed data and a flag indicating if there's more data to come. The client-side would h…

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@rreeves8
Comment options

@gustavopch
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@rreeves8
Comment options

@vladinator1000
Comment options

Comment options

You must be logged in to vote
1 reply
@lodi-g
Comment options

Answer selected by rreeves8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants