(path: str, timeout_s: float)
| 190 | |
| 191 | |
| 192 | def wait_for_socket(path: str, timeout_s: float) -> bool: |
| 193 | deadline = time.time() + timeout_s |
| 194 | while time.time() < deadline: |
| 195 | if os.path.exists(path): |
| 196 | try: |
| 197 | sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
| 198 | sock.connect(path) |
| 199 | sock.close() |
| 200 | return True |
| 201 | except OSError: |
| 202 | pass |
| 203 | time.sleep(0.05) |
| 204 | return False |
| 205 | |
| 206 | |
| 207 | def launch_interactive(argv: list[str], cwd: Path, env: dict[str, str], timeout_s: float, settle_s: float) -> SessionLaunch: |