MCPcopy
hub / github.com/python-trio/trio / agen

Function agen

src/trio/_core/_tests/test_guest_mode.py:686–694  ·  view source on GitHub ↗
(label: str)

Source from the content-addressed store, hash-verified

684 record = set()
685
686 async def agen(label: str) -> AsyncGenerator[int, None]:
687 assert sniffio.current_async_library() == label
688 try:
689 yield 1
690 finally:
691 library = sniffio.current_async_library()
692 with contextlib.suppress(trio.Cancelled):
693 await sys.modules[library].sleep(0)
694 record.add((label, library))
695
696 async def iterate_in_aio() -> None:
697 await agen("asyncio").asend(None)

Callers 2

iterate_in_aioFunction · 0.70
trio_mainFunction · 0.70

Calls 3

gc_collect_harderFunction · 0.85
addMethod · 0.80
AClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…