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

Function demux_adaptor

docker/utils/socket.py:177–187  ·  view source on GitHub ↗

Utility to demultiplex stdout and stderr when reading frames from the socket.

(stream_id, data)

Source from the content-addressed store, hash-verified

175
176
177def demux_adaptor(stream_id, data):
178 """
179 Utility to demultiplex stdout and stderr when reading frames from the
180 socket.
181 """
182 if stream_id == STDOUT:
183 return (data, None)
184 elif stream_id == STDERR:
185 return (None, data)
186 else:
187 raise ValueError(f'{stream_id} is not a valid stream')

Callers 1

_read_from_socketMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected