MCPcopy Index your code
hub / github.com/callstack/agent-device / waitForProcessExit

Function waitForProcessExit

src/utils/process-identity.ts:89–97  ·  view source on GitHub ↗
(pid: number, timeoutMs: number)

Source from the content-addressed store, hash-verified

87}
88
89export async function waitForProcessExit(pid: number, timeoutMs: number): Promise<boolean> {
90 if (!isProcessAlive(pid)) return true;
91 const start = Date.now();
92 while (Date.now() - start < timeoutMs) {
93 await sleep(50);
94 if (!isProcessAlive(pid)) return true;
95 }
96 return !isProcessAlive(pid);
97}
98
99export async function stopProcessForTakeover(
100 pid: number,

Callers 6

stopCompanionProcessFunction · 0.90
stopSpawnedMetroProcessFunction · 0.90
stopProcessFunction · 0.90
stopProcessForTakeoverFunction · 0.70

Calls 2

sleepFunction · 0.90
isProcessAliveFunction · 0.85

Tested by 1

stopProcessFunction · 0.72