News for hackers. Stuff that matters.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by joombar on Friday October 18, 2013 @09:50AM (#6571338)
No changes required. It should accept any JSON resource.

Having said that, there's a much bigger improvement if you're progressively writing out the JSON rather than doing it in one big lump.

Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by jbrooksuk on Friday October 18, 2013 @09:53AM (#6571344)
Awesome! I'll investigate how easily we can stream our JSON out.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by justincormack on Friday October 18, 2013 @10:18AM (#6571475)
Its probably not worth changing it if it is eg in a file already, but if the process to generate it is a slow one it might be.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by joombar on Friday October 18, 2013 @10:45AM (#6571641)
I agree. If you're doing something slow/asynchronous like aggregating several http resources it is worth it to write out as early as you can but keep server-side the same if you can generate the whole JSON quickly.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by reddit_clone on Friday October 18, 2013 @11:29AM (#6571913)
One issue I found with writing early is handling error condition(s).

On the server side, you may run into an error after you started writing out your reply. That may cause an incomplete reply. It may require more involved error handling between the server and client. 'Gather first write later' approach gives you a simpler error propagation between server and client.

Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by jbrooksuk on Friday October 18, 2013 @11:22AM (#6571875)
Nope, just parsing some results back from MySQL.
Re:Oboe.js: reacting to Ajax/Rest quicker by not waiting for... by jongleberry on Saturday October 19, 2013 @12:14AM (#6575305)
here's a streams2 library for streaming to the client as an array: https://github.com/stream-utils/streaming-json-stringify