MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / waitForExit

Function waitForExit

apps/local/src/mcp.ts:303–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301 const transport = new StdioServerTransport();
302
303 const waitForExit = () =>
304 new Promise<void>((resolve) => {
305 const finish = () => {
306 process.off("SIGINT", finish);
307 process.off("SIGTERM", finish);
308 process.stdin.off("end", finish);
309 process.stdin.off("close", finish);
310 resolve();
311 };
312 process.once("SIGINT", finish);
313 process.once("SIGTERM", finish);
314 process.stdin.once("end", finish);
315 process.stdin.once("close", finish);
316 });
317
318 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: stdio server lifetime uses Promise-based SDK/process APIs and always closes resources
319 try {

Callers 1

runMcpStdioServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected