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

Class CustomAsyncIterable

tests/test_responses.py:158–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156) -> None:
157 async def app(scope: Scope, receive: Receive, send: Send) -> None:
158 class CustomAsyncIterable:
159 async def __aiter__(self) -> AsyncIterator[str | bytes]:
160 for i in range(5):
161 yield str(i + 1)
162
163 response = StreamingResponse(CustomAsyncIterable(), media_type="text/plain")
164 await response(scope, receive, send)

Callers 1

appFunction · 0.85

Calls

no outgoing calls

Tested by 1

appFunction · 0.68