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

Function isProcessAlive

src/utils/process-identity.ts:11–19  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

9];
10
11export function isProcessAlive(pid: number): boolean {
12 if (!Number.isInteger(pid) || pid <= 0) return false;
13 try {
14 process.kill(pid, 0);
15 return true;
16 } catch (err) {
17 return (err as NodeJS.ErrnoException).code === 'EPERM';
18 }
19}
20
21export function isProcessGroupAlive(pid: number): boolean {
22 if (!Number.isInteger(pid) || pid <= 0) return false;

Callers 14

shouldReuseCompanionFunction · 0.90
stopCompanionProcessFunction · 0.90
isLiveProcessLockOwnerFunction · 0.90
stopProcessFunction · 0.90
isRunnerLeaseOwnerAliveFunction · 0.90
isRunnerProcessAliveFunction · 0.90

Calls 1

killMethod · 0.45

Tested by 1

stopProcessFunction · 0.72