4 ms·
Is there any information out there regarding streams / chunked responses within Rails? (I'm not talking about the new template stream facility, but generating a
by lloeki 14y ago
Is there any information out there regarding streams / chunked responses within Rails? (I'm not talking about the new template stream facility, but generating arbitrary data)
I'm currently using enumerators assigned to response_body:
self.status_code = 200
self.response_body = Enumerator.new { |y| ... }
I'm hitting a number of problems though, e.g unicorn killing long-lived workers.
- jollyjerry 14y agoCould you link to a fuller gist? Is self referring to an ActionDispatch::Response object? I plan on improving rails integration with rack-stream so that you can call `#chunk` from controllers and that will defer sending a chunk of content.
- lloeki 14y agoHere goes: https://gist.github.com/2823045 https://gist.github.com/2823045
- deleted 14y ago[deleted]