Concatenated JSON

Concatenated JSON

[1] JSON Streaming - Wikipedia, the free encyclopedia ( 版) <http://en.wikipedia.org/wiki/JSON_Streaming>

[2] Noggit, the JSON Streaming Parser - Solr 'n Stuff ( 版) <http://yonik.com/noggit-json-parser/>

Concatenated JSON Streaming

Noggit can also handle multiple JSON values streamed over a single connection and simply catenated together. Primitive values should of course be separated by whitespace to avoid ambiguity.

{first_object:10}

['another array object']['yet another object']

{more:objects}{another:object}

['who knows how many json values will be streamed by the writer...']

42

"is this the end?"

[3] simple is better - JSON-RPC 2.0 Transport: Sockets (Roland Koebler 著, 版) <http://www.simple-is-better.org/json-rpc/transport_sockets.html#pipelined-requests-responses-json-splitter>

It's also possible to use a single connection for several Requests/Responses without an additional encoding. Then, (a) a streaming JSON-decoder or (b) a streaming JSON-splitter is needed, which detects the end of a JSON-object/array. Then, several JSON-RPC Requests can simply be pipelined on a single connection.

Streaming JSON-decoders seem to be rare, but a JSON-splitter which only detects the end of a JSON-object/array can easily be implemented (see below).

[4] simple is better - JSON-RPC 2.0 Transport: HTTP (Roland Koebler 著, 版) <http://www.simple-is-better.org/json-rpc/transport_http.html>

high-performance servers MAY allow several concatenated JSON-RPC Requests in a single HTTP message by using e.g. a JSON-splitter, and MAY then return concatenated Responses.

[5] Read-only Formats ( 版) <http://kitesdk.org/docs/0.18.0/read-only-formats.html>

Kite can read JSON files that contain concatenated or whitespace-separated JSON objects that conform to the JSON specification.

[6] Catmandu::Exporter::JSON - search.cpan.org ( 版) <http://search.cpan.org/dist/Catmandu/lib/Catmandu/Exporter/JSON.pm>

This Catmandu::Exporter exports items serialized in JSON format. By default each item is printed condensed on one line.

array

Seralize items as one JSON array instead of concatenated JSON objects.

[7] Catmandu::Importer::JSON - search.cpan.org ( 版) <http://search.cpan.org/dist/Catmandu/lib/Catmandu/Importer/JSON.pm>

multiline switches optionally between line-delimited JSON and multiline JSON or arrays. the default is line-delimited JSON.

[8] application/orchestrate-export-stream+json