Files
2012-02-21 01:15:00 -05:00

1 line
2.1 KiB
JSON

[{"user_id": 1648, "stars": [], "topic_id": 19574, "date_created": 1302850054.741818, "message": "I'd investigate Goliath", "group_id": 447, "id": 696996}, {"user_id": 7794, "stars": [], "topic_id": 19574, "date_created": 1302849239.9931991, "message": "I am trying to create a stream of JPEG images to display in the browser. it's pretty simple outlined here: http://www.jpegcameras.com/ under Motion JPEG formats. I've found plenty of examples of how to do this in other languages and frameworks, but how would I do this in rails? How can I write part of the response, send it, and then after a minute or two send more data? Content-Type: multipart/x-mixed-replace with boundaries make it possible to do so within the HTTP spec, but I can't figure out how to make rails do it.", "group_id": 447, "id": 696806}, {"user_id": 1648, "stars": [], "topic_id": 19574, "date_created": 1302850020.5266769, "message": "sending data multiple times is bending the Rack protocol rules a bit, so I'm not sure it's possible / a good idea to do in Rails", "group_id": 447, "id": 696995}, {"user_id": 7794, "stars": [], "topic_id": 19574, "date_created": 1302851846.322876, "message": "I'm making some headway with self.response = proc { |response,output| output.write(\"something\\n\"); sleep 2; output.write(\"something else\");}", "group_id": 447, "id": 697267}, {"user_id": 7794, "stars": [], "topic_id": 19574, "date_created": 1302851886.5653501, "message": "with webbrick it doesn't do anything special, but with mongrel, curl at least gets the first \"something\" and then waits 2 seconds for the other \"something else\"", "group_id": 447, "id": 697270}, {"user_id": 7794, "stars": [], "topic_id": 19574, "date_created": 1302851893.854254, "message": "but I can't get a web browser to recognize it", "group_id": 447, "id": 697271}, {"user_id": 7794, "stars": [], "topic_id": 19574, "date_created": 1302855607.2812829, "message": "So for the records sake, I got it working. between my boundaries, I needed to specify content type and the newlines needed to be just right. One problem here is that if the connection dies for any reason, rails will hang.", "group_id": 447, "id": 697856}]