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

Method wait_startup

starlette/testclient.py:537–552  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

535 await self.stream_send.send(None)
536
537 async def wait_startup(self) -> None:
538 await self.stream_receive.send({"type": "lifespan.startup"})
539
540 async def receive() -> Any:
541 message = await self.stream_send.receive()
542 if message is None:
543 self.task.result()
544 return message
545
546 message = await receive()
547 assert message["type"] in (
548 "lifespan.startup.complete",
549 "lifespan.startup.failed",
550 )
551 if message["type"] == "lifespan.startup.failed":
552 await receive()
553
554 async def wait_shutdown(self) -> None:
555 async def receive() -> Any:

Callers

nothing calls this directly

Calls 2

receiveFunction · 0.50
sendMethod · 0.45

Tested by

no test coverage detected