2 ms·
Jason can't be streamed: wtf? If you have a data connection that can be broken, every data format is incomplete until the last ack There is absolutely nothing
by AtlasBarfed 2y ago
Jason can't be streamed: wtf? If you have a data connection that can be broken, every data format is incomplete until the last ack
There is absolutely nothing stopping you from parsing json as it comes in. An open array that hasn't reached the closing arrays character yet? How is that different than a stream of data elements?
With the Jackson API, I was easily able to parse incoming text into Json tokens and extract data as it came in. I did this for certain corner cases where Json documents possibly were sent in that were greater than could be practically put into memory.
Sure, you might want to have a rollback function in case there is a break in the data transfer, but how'd that be different with a different data format streamed?
The guy is complaining a lot about number formats. If you care about it that much just put your numbers and strings, and make the parsing format part of the standard /api interface.
This guy simply appears to be in love with binary formats and strong typing. If that floats his boat by all means do it.
The fact that so much of the web relies on Json, and it pretty much seems to work. The guy hopefully indicated some corner cases on its use. But come on it's not fatally flawed.
- dekhn 2y agoI stream JSON as a series of closed JSON documents. Parsing incomplete JSON just seems like a minefield of errors.