streaming responses from rack middlewares seems to get buffered.
when i run the following SSE rack app: https://gist.github.com/1497500
and request it by:
curl -N http://localhost:8080/eventstream/jada
it gives nothing until you've sent about 35440 bytes..
i checked the code, it doesn't seems like torquebox is buffering anything, but maybe the ServletResponse does?
strong indicators are methods like flushBuffer and getBufferSize
Fixed in https://github.com/torquebox/torquebox/pull/63
Slating for fix in 2.0.0beta3
my fix is kind of unobtrusive as it only flushes the response if it's a chunked transfer encoding.
the fix also suppresses "client abort" exceptions as these are common (and harmless).
the fix is heavily inspired by jruby-rack (https://github.com/jruby/jruby-rack/blob/master/src/main/ruby/jruby/rack/response.rb#L100)
Pull request merged in https://github.com/torquebox/torquebox/commit/69b89ee02f41aadebe873053dd0f483d1a3efaae