MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _iter

Function _iter

tests/lib/environments/test_worker.py:221–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

219 }
220
221 async def _iter() -> AsyncIterator[Any]:
222 # With no `serve` the session completes on its own (no tool
223 # calls) once the lease heartbeat has had a chance to land, and
224 # the run ends via the normal session-completion path; the
225 # heartbeat keeps the lease alive throughout and is stopped on the
226 # way out.
227 if serve is not None:
228 await serve()
229 else:
230 await asyncio.sleep(0.05)
231 record["send_retry_window"] = send_retry_window() if send_retry_window else None
232 return
233 yield # pragma: no cover (makes this an async generator function)
234
235 yield _iter()
236

Callers 3

fake_run_session_toolsFunction · 0.85
listMethod · 0.85
listMethod · 0.85

Calls 2

sleepMethod · 0.80
serveFunction · 0.70

Tested by

no test coverage detected