MCPcopy Create free account
hub / github.com/analogdotnow/Analog / waitForProcess

Function waitForProcess

packages/runtime-secure-exec/src/index.ts:313–332  ·  view source on GitHub ↗
(
  proc: KernelProcess,
  timeoutMs: number,
)

Source from the content-addressed store, hash-verified

311 });
312
313const waitForProcess = (
314 proc: KernelProcess,
315 timeoutMs: number,
316): Effect.Effect<ProcessOutcome, SecureExecExecutionError> =>
317 use("process.wait", proc, (p) => p.wait()).pipe(
318 Effect.map(
319 (exitCode): ProcessOutcome => ({
320 _tag: "Exited",
321 exitCode,
322 }),
323 ),
324 Effect.timeoutOrElse({
325 duration: Duration.millis(timeoutMs),
326 orElse: () =>
327 Effect.sync((): ProcessOutcome => {
328 proc.kill(9);
329 return { _tag: "TimedOut" };
330 }),
331 }),
332 );
333
334const runEntryProcess = (
335 kernel: SecureExecKernel,

Callers 1

runEntryProcessFunction · 0.85

Calls 2

useFunction · 0.85
syncMethod · 0.65

Tested by

no test coverage detected