MCPcopy Index your code
hub / github.com/commandoperator/cmdop-sdk / _read_loop

Method _read_loop

python/src/cmdop/_transport.py:144–158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

142 return
143
144 async def _read_loop(self) -> None:
145 assert self._proc is not None and self._proc.stdout is not None
146 reader = self._proc.stdout
147 try:
148 while True:
149 body = await _read_delimited(reader)
150 env = pb.Envelope()
151 env.ParseFromString(body)
152 self._dispatch(env)
153 except asyncio.IncompleteReadError:
154 self._fail_all(CmdopConnectionError("cmdop-core exited"))
155 except asyncio.CancelledError:
156 raise
157 except Exception as exc: # noqa: BLE001
158 self._fail_all(CmdopConnectionError(f"core read loop failed: {exc}"))
159
160 def _dispatch(self, env: pb.Envelope) -> None:
161 """Route a frame by id, branch on kind (report 13 §4.1)."""

Callers 3

_ensure_startedMethod · 0.95
_make_transportFunction · 0.95
_make_transportFunction · 0.95

Calls 3

_dispatchMethod · 0.95
_fail_allMethod · 0.95
_read_delimitedFunction · 0.85

Tested by 2

_make_transportFunction · 0.76
_make_transportFunction · 0.76