You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: align the docs with the unified execution backend
Update the prose and interface listings for the execution changes:
the shell wire field is source rather than command and carries an
optional structured input; the exit event carries an optional
structured result; the workspace no longer takes a waitUntil hook and
a JavaScript run stays alive while its event stream is consumed; and
the host command driver is the CommandExecutor, with encoding and
result accumulation living in the runtime.
Touches the capnweb wire contract, the runtime lifecycle and worker
backend notes, the isolate JavaScript guide, the runtime migration
table, and the computer and example READMEs.
Copy file name to clipboardExpand all lines: docs/17_isolate_javascript.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@ import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-ja
8
8
9
9
const workspace =newWorkspace({
10
10
storage: ctx.storage,
11
-
waitUntil: ctx.waitUntil.bind(ctx),
12
11
backends: [
13
12
newWorkerJavaScriptBackend({
14
13
loader: env.LOADER,
@@ -52,7 +51,7 @@ const result = await handle.result();
52
51
53
52
The source is a real ES module. Static imports, literal dynamic imports, and top-level await are supported. If the module default-exports a function, Workspace invokes it with `options.input`. Otherwise module evaluation completes with a `null` structured result.
54
53
55
-
`waitUntil` is required for this backend. `runtime.exec()` returns before the Dynamic Worker finishes, so the host must attach completion to the Durable Object event lifetime. Construction fails when a module backend connects without this hook.
54
+
`runtime.exec()` returns before the Dynamic Worker finishes: the run keeps advancing while its event stream is consumed and the host call into the Dynamic Worker stays in flight. That pending work keeps the Durable Object resident on its own. A run whose handle is returned but never read can be evicted once the object goes idle; drain the event stream (or `result()`) to keep the run alive, and schedule an alarm through `ctx.storage.setAlarm()` for work that must survive eviction.
0 commit comments