2546961Plate mechanics lab: Kirchhoff-Love plates solved by numbl in the browserJeremy Magland 1import type { BackendInfo, RunRequest, RunResult, Runner } from "./types";
2import { executeBundle, numblVersion } from "./execute";
4/** Runs numbl in the current Node process. Used by tests and scripts; cannot cancel. */
5export class NodeRunner implements Runner {
6 private readonly info: BackendInfo = { engine: "numbl", version: numblVersion(), optimization: "1", host: "node" };
7 readonly backend = Promise.resolve(this.info);
9 run(req: RunRequest, onOutput?: (text: string) => void): Promise<RunResult> {
10 return Promise.resolve(executeBundle(req, this.info, onOutput));
11 }
12 cancel(): void {
13 /* synchronous host: nothing in flight between awaits */
14 }
15 dispose(): void {
16 /* nothing to release */
17 }
18}