Building Streaming REST APIs with Ruby(intridea.com) |
Building Streaming REST APIs with Ruby(intridea.com) |
This is why socket.io and its contemporaries have several layers of fallbacks, even going back to infinite iframe/JSONP polling.
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.