mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
chord/next/http: a Web fetch handler built from the registry Http (routes, wraps, sockets, hosts, relays, CSP sources) and Authenticators, responses as descriptions, a security baseline on by default, Chord's own Node listener as a host-lifetime object, nodeRequest for apps mounting it, links and plugin sockets. chord/next/workers: a forked worker per address, started on demand, stopped when idle, never restarted by itself, plugins built by the server and shipped. Plugins: kinds with platform and host packages, createPluginRuntime, scripts(kind), rollout results per host, imports of other plugins by name. Kernel: RouteHandle (retry, suspend), no route backoff, anonymous host.root, origins only from relays. ws is an optional peer dependency.
12 lines
604 B
TypeScript
12 lines
604 B
TypeScript
// Fixture child process (slice 10): writes to stdout and stderr, spawns a grandchild, sends a link frame and a control
|
|
// message at once, then lives until killed.
|
|
|
|
import { spawn } from "node:child_process";
|
|
import { envelope } from "../../../../src/next-node/workers/control.ts";
|
|
|
|
const grandchild = spawn(process.execPath, ["-e", "setTimeout(() => {}, 60000)"], { stdio: "ignore" });
|
|
process.stdout.write(`grandchild ${grandchild.pid}\n`);
|
|
process.stderr.write("an error line\n");
|
|
process.send?.(new Uint8Array([1, 2, 3]));
|
|
process.send?.(envelope({ kind: "started" }));
|
|
setInterval(() => {}, 1000);
|