phlex icon indicating copy to clipboard operation
phlex copied to clipboard

Components should be streamable in Rails

Open joeldrapper opened this issue 1 year ago • 1 comments

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.

joeldrapper avatar Jul 22 '22 10:07 joeldrapper

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.

joeldrapper avatar Jul 25 '22 21:07 joeldrapper

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 <<.

joeldrapper avatar Sep 21 '22 18:09 joeldrapper