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

Method is_disconnected

starlette/requests.py:328–340  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

326 await self._form.close()
327
328 async def is_disconnected(self) -> bool:
329 if not self._is_disconnected:
330 message: Message = {}
331
332 # If message isn't immediately available, move on
333 with anyio.CancelScope() as cs:
334 cs.cancel()
335 message = await self._receive()
336
337 if message.get("type") == "http.disconnect":
338 self._is_disconnected = True
339
340 return self._is_disconnected
341
342 async def send_push_promise(self, path: str) -> None:
343 if "http.response.push" in self.scope.get("extensions", {}):

Callers 2

appFunction · 0.95
dispatchMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 2

appFunction · 0.76
dispatchMethod · 0.64