On Mar 26, 3:46 pm, Joshua Peek <
j...@joshpeek.com> wrote:
> Definitely sounds like a class reloading issue. I think the class
> reloader (trigged by AC::Reloader middleware) removes the Order model,
> then the actual server tries to call the stream block and the model is
> missing. (At least we know Rack streaming is working ;)
Interesting - I'll try to read up on how the Reloader middleware gets
triggered.
> One solution would be to have the AC::Reloader middleware buffer all
> the responses into a plain string it returns to the server. This
> normally would be bad for performance, but its okay cause it would
> only affect development.
Well, it would be better to see the buffer flushed in realtime, like
it worked in 2.2. Maybe there's a way to simply "pause" any reloading
until after the render_text statement is finished?
By the way, the current docs say that the proc will get arguments like
this:
Proc.new { |response, output| .... }
but in 2.3, both parameters seem to be of class Response; and whereas
we used to call output.flush when we wanted to send a chunk of data
back to the browser, I think output.write (really response.write) is
autoflushing on every call. Which is probably fine, but unfortunately
the .flush method was removed and broke our code. Either the
signature should change to just pass one response object, or I'm
guessing the signature was preserved to try not to break old code, in
which case we should add a no-op flush() method.
Jeff