MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / wait

Method wait

src/mcp/os/win32/utilities.py:76–84  ·  view source on GitHub ↗

Waits for exit by polling the Popen. A thread blocked in Popen.wait() cannot be cancelled by anyio, which would defeat every timeout placed around this call.

(self)

Source from the content-addressed store, hash-verified

74 self.stdout = FileReadStream(cast(BinaryIO, stdout)) if stdout else None
75
76 async def wait(self) -> int:
77 """Waits for exit by polling the Popen.
78
79 A thread blocked in Popen.wait() cannot be cancelled by anyio, which
80 would defeat every timeout placed around this call.
81 """
82 while (returncode := self.popen.poll()) is None:
83 await anyio.sleep(_EXIT_POLL_INTERVAL)
84 return returncode
85
86 def terminate(self) -> None:
87 """Terminates the subprocess."""

Calls

no outgoing calls