MCPcopy Create free account
hub / github.com/encode/starlette / create_collapsing_task_group

Function create_collapsing_task_group

starlette/_utils.py:105–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104@asynccontextmanager
105async def create_collapsing_task_group() -> AsyncGenerator[anyio.abc.TaskGroup, None]:
106 try:
107 async with anyio.create_task_group() as tg:
108 yield tg
109 except BaseExceptionGroup as excs:
110 if len(excs.exceptions) != 1:
111 raise
112
113 exc = excs.exceptions[0]
114 context = None if exc.__suppress_context__ else exc.__context__
115 raise exc from exc.__cause__ or context
116
117
118def parse_host_header(host_header: str | None) -> ParsedHost | None:

Callers 5

__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90

Calls

no outgoing calls