News for hackers. Stuff that matters.
Re:Live Streaming in Rails 4.0 by randomdata on Monday July 30, 2012 @05:36PM (#4314810)
In sufficiently modern versions of Rails you could write:

    def index
      self.response_body = Enumerator.new do |socket|
        100.times do
          socket << "hello world"
        end
      end
    end
Your API is a little less verbose, I'll give you that, but I don't see why you need Queues and Threads unless the problem actually calls for those things. It still looks like you are writing to a socket either way.
Re:Live Streaming in Rails 4.0 by lloeki on Tuesday July 31, 2012 @04:05AM (#4316204)
That's what I do, encapsulated in a bunch of methods aggregated in a streaming module. Don't forget to set this if you're using nginx (which my module does).

    headers['X-Accel-Buffering'] = 'no'