Ensuring response chunks are streamed in order using Turbo Streams #396
Replies: 1 comment 1 reply
-
The code for that says: https://rubyllm.com/rails/#message-ordering-issues
Happy to accept a PR to solve it though. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Many thanks for an amazing library @crmne 🙏 One possibly naive question I wanted to ask: I'm following the Hotwire/Turbo streaming implementation laid our in the gem's documentation, and as I'm streaming the response chunks from a chat message, they are appended to the DOM not necessarily in the right order:
Once the streaming is complete, the message is updated and the DOM is refreshed one last time with the message's content properly laid out:

Can you suggest approaches to ensure that the streaming is done in such a way that the chunks are broadcast in-order? The code I'm using is pretty much lifted from the docs, but let me know if it's be helpful to share what I wrote.
Beta Was this translation helpful? Give feedback.
All reactions