@wasm-oj/server 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/crates/runtime-core/src/deterministic.rs +27 -1
- package/crates/runtime-core/src/interactive.rs +233 -111
- package/crates/runtime-core/src/meter.rs +8 -55
- package/crates/runtime-core/src/run/mod.rs +2 -0
- package/crates/runtime-core/src/run/native.rs +1 -1
- package/crates/runtime-core/src/run/web.rs +35 -12
- package/crates/runtime-core/src/run/web_interactive.rs +370 -0
- package/crates/runtime-core/src/web.rs +52 -6
- package/dist/chunks/process-keepalive-BaXpMTap.js +191 -0
- package/dist/index.js +107 -18
- package/dist/server-build-stage.mjs +11 -94
- package/dist/server-runner-stage.mjs +73 -4
- package/package.json +3 -3
- package/dist/chunks/process-keepalive-BWLUz55N.js +0 -16
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/server/process-keepalive.mjs
|
|
2
|
-
/**
|
|
3
|
-
* Keep Node alive while a promise is backed only by a foreign async runtime.
|
|
4
|
-
* Top-level await does not itself create a referenced libuv handle, so Node can
|
|
5
|
-
* otherwise exit with code 13 while a Wasmer SDK operation is still pending.
|
|
6
|
-
*/
|
|
7
|
-
async function withProcessKeepalive(promise) {
|
|
8
|
-
const keepalive = setInterval(() => void 0, 6e4);
|
|
9
|
-
try {
|
|
10
|
-
return await promise;
|
|
11
|
-
} finally {
|
|
12
|
-
clearInterval(keepalive);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { withProcessKeepalive as t };
|