MCPcopy
hub / github.com/encode/starlette / wrap

Method wrap

starlette/responses.py:275–277  ·  starlette/responses.py::StreamingResponse.wrap
(func: Callable[[], Awaitable[None]])

Source from the content-addressed store, hash-verified

273 async with create_collapsing_task_group() as task_group:
274
275 async def wrap(func: Callable[[], Awaitable[None]]) -> None:
276 await func()
277 task_group.cancel_scope.cancel()
278
279 task_group.start_soon(wrap, partial(self.stream_response, send))
280 await wrap(partial(self.listen_for_disconnect, receive))

Callers

nothing calls this directly

Calls 1

funcFunction · 0.85

Tested by

no test coverage detected