As in the Go stdio: the runtime's answer names its typed fault in the error's data error-kind, kept on the error as errorKind (isStopping); a broker request (mesh/ask) met by stopping is asked again after a pause at the kept-call pace (the settings kept-call-pace-first and -max, 1 s doubling to 30 s by default) until the new runner answers or 60 s end, then the fault is the caller's. A plain refusal is never asked again; a TypeScript bundle (the forge, the registries' holder) meets a restarting runner as a Go one does. Builds: design 47 H2 H-A-542, H-A-544
17 lines
764 B
JavaScript
17 lines
764 B
JavaScript
// A launched bundle whose one tool asks a seat's verb through the runtime, and says how the ask ended: its answer, or
|
|
// whether its fault was the typed fault stopping (design 47 H2 H-A-542, H-A-544).
|
|
import { broker } from "../../dist/messaging/index.js";
|
|
import { registerModuleTools } from "../../dist/tools/index.js";
|
|
import { serveRegisteredOverStdio, isStopping } from "../../dist/stdio/index.js";
|
|
|
|
registerModuleTools("builder", () => [
|
|
{ name: "publish", description: "asks the registry", input: {}, run: async () => {
|
|
try {
|
|
return { answer: await broker().request("seat:go-package-registry.publish", {}) };
|
|
} catch (err) {
|
|
return { stopping: isStopping(err), words: err.message };
|
|
}
|
|
} },
|
|
]);
|
|
await serveRegisteredOverStdio();
|