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

Method wait_for

server/scripts/phase_split_dual_gpu.py:100–111  ·  view source on GitHub ↗
(self, needle: str, timeout_s: float)

Source from the content-addressed store, hash-verified

98 self._thread.start()
99
100 def wait_for(self, needle: str, timeout_s: float) -> None:
101 deadline = time.time() + timeout_s
102 tail: list[str] = []
103 while time.time() < deadline:
104 try:
105 line = self.queue.get(timeout=0.2)
106 tail.append(line)
107 if needle in line:
108 return
109 except queue.Empty:
110 pass
111 raise TimeoutError(f"timed out waiting for {needle!r}; tail={tail[-12:]}")
112
113
114class PFlashDaemon:

Callers 3

runMethod · 0.80
dequeueMethod · 0.80
startMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected