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)
| 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.""" |
no outgoing calls