接续L4-TOOL-DB浏览器Provider协议
结论:浏览器 Worker 已支持可插拔 Python runtime provider 的 line I/O,缺真实 Python/WASM runtime 时仍保持阻塞不解锁。
This commit is contained in:
@@ -577,7 +577,9 @@ private module paths:
|
||||
boundary. The bundled worker reports
|
||||
`blocked_browser_python_wasm_runtime_missing` until a real Python/WASM runtime
|
||||
is installed; the Worker shell alone must not mark `DB_PROGRAM` execution
|
||||
ready.
|
||||
ready. The Worker supports a provider protocol (`start`, `writeLine`,
|
||||
`readLine`, `close`) so a future Python/WASM runtime can provide line-based
|
||||
`DB_PROGRAM` I/O without changing `ToolDbProcessPort`.
|
||||
- `createLinuxCncToolDbNodeRuntimeAdapter()` in
|
||||
`runtime/sdk/src/tool-db-node-runtime-adapter.js` for Node/native verification
|
||||
of the real LinuxCNC `DB_PROGRAM` child process. This adapter is intentionally
|
||||
|
||||
@@ -96,7 +96,14 @@ export function createLinuxCncToolDbBrowserWorkerAdapter({
|
||||
return result.line;
|
||||
},
|
||||
|
||||
close() {
|
||||
async close() {
|
||||
if (worker) {
|
||||
try {
|
||||
await request("close");
|
||||
} catch {
|
||||
// The worker may be blocked or already gone; termination below is authoritative.
|
||||
}
|
||||
}
|
||||
rejectPending(new Error("Tool DB browser worker closed."));
|
||||
worker?.terminate();
|
||||
worker = null;
|
||||
|
||||
Reference in New Issue
Block a user