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

Method __aiter__

python/src/cmdop/streaming.py:182–197  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

180 self._id: int | None = None
181
182 async def __aiter__(self) -> AsyncIterator[AskFrame]:
183 from cmdop._transport import _STREAM_END # local import: avoid cycle
184
185 self._id, queue = await self._t._start_stream(self._req)
186 while True:
187 item = await queue.get()
188 if item is _STREAM_END:
189 return
190 if isinstance(item, BaseException):
191 # transport-level failure (core crashed / EOF mid-stream).
192 raise item
193 if item.kind == pb.Envelope.KIND_ERROR:
194 # ask stream's terminal error frame. PIN-gate verdicts surface as
195 # their typed exception (PinDeniedError / PinTimeoutError).
196 raise _stream_error(item.error.code or "", item.error.message or "")
197 yield _frame_from_envelope(item)
198
199 async def pin(self, challenge_id: str, pin: str) -> None:
200 """Answer a ``pin_required`` frame with the entered connection PIN."""

Callers

nothing calls this directly

Calls 4

_stream_errorFunction · 0.85
_frame_from_envelopeFunction · 0.85
_start_streamMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected