Hacker News new | ask | show | jobs
by lloeki 5132 days 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.
1 comments

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