MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / attach

Method attach

server/scripts/phase_split_dual_gpu.py:88–98  ·  view source on GitHub ↗
(self, proc: subprocess.Popen[bytes])

Source from the content-addressed store, hash-verified

86 self._thread: threading.Thread | None = None
87
88 def attach(self, proc: subprocess.Popen[bytes]) -> None:
89 def reader() -> None:
90 assert proc.stdout is not None
91 for raw in iter(proc.stdout.readline, b""):
92 self._file.write(raw)
93 self._file.flush()
94 self.queue.put(raw.decode("utf-8", errors="replace").rstrip("\n"))
95 self._file.close()
96
97 self._thread = threading.Thread(target=reader, daemon=True)
98 self._thread.start()
99
100 def wait_for(self, needle: str, timeout_s: float) -> None:
101 deadline = time.time() + timeout_s

Callers 1

startMethod · 0.45

Calls 1

startMethod · 0.45

Tested by

no test coverage detected