0x1c

Bummer! Rails dynamic streaming doesn't work

Mar 31, 2009

Rails dynamic streaming doesn't work. At least sometimes. While the Rails documentation, and all the euphoric comments in the community feature code examples along the lines of

1
2
3
# Renders "Hello from code!"
render :text => proc { |response, output| 
  output.write("Hello from code!") }

But this just doesn't work as not-really-advertised. The reason? While rails correctly - that is to say in the way it is documented - does write directly to the output stream, at least with Mongrel the output stream is just a String.

So whatever you are doing: the entire request is still collected in RAM. Bummer!

Toggle Comments