MCPcopy Index your code
hub / github.com/docker/docker-py / json_stream

Function json_stream

docker/utils/json_stream.py:35–40  ·  view source on GitHub ↗

Given a stream of text, return a stream of json objects. This handles streams which are inconsistently buffered (some entries may be newline delimited, and others are not).

(stream)

Source from the content-addressed store, hash-verified

33
34
35def json_stream(stream):
36 """Given a stream of text, return a stream of json objects.
37 This handles streams which are inconsistently buffered (some entries may
38 be newline delimited, and others are not).
39 """
40 return split_buffer(stream, json_splitter, json_decoder.decode)
41
42
43def line_splitter(buffer, separator='\n'):

Callers 4

_stream_helperMethod · 0.90
buildMethod · 0.90

Calls 1

split_bufferFunction · 0.85

Tested by 2