phlex
phlex copied to clipboard
Components should be streamable in Rails
It looks like streaming in Rails is handled here. https://github.com/rails/rails/blob/04972d9b9ef60796dc8f0917817b5392d61fcf09/actionpack/lib/action_controller/metal/streaming.rb#L195-L220
It takes a Rack::Chunked::Body
which takes an enumerator. Rack made the decision to depreciate this module and delegate it to the server.
I think this is mostly made possible with #42, but I’m the issue open until we've conducted further testing. I don't know if we need some kind of batch chunker to get the best performance from HTTP streaming. Never even looked into it before.
I’m closing this as I don't have any plans to revisit streaming at this time. At least not until Rails / Rack / Puma figure out who's responsible for what. Phlex works off a simple string buffer, and its only requirement is that the buffer respond to <<
.