MCPcopy Index your code
hub / github.com/nodejs/node / killAndWait

Function killAndWait

lib/internal/main/watch_mode.js:125–140  ·  view source on GitHub ↗
(signal = kKillSignal, force = false)

Source from the content-addressed store, hash-verified

123}
124
125async function killAndWait(signal = kKillSignal, force = false) {
126 const processToKill = child;
127 const onExit = childExitPromise;
128 if (!processToKill) {
129 return;
130 }
131 if ((processToKill.killed || exited) && !force) {
132 return;
133 }
134 stopping = true;
135 if (!exited && processToKill.exitCode === null && processToKill.signalCode === null) {
136 processToKill.kill(signal);
137 }
138 const exitCode = await onExit;
139 return exitCode;
140}
141
142function reportGracefulTermination() {
143 // Log if process takes more than 500ms to stop.

Callers 2

stopFunction · 0.85
signalHandlerFunction · 0.85

Calls 1

killMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…