@nxtedition/lib 23.9.12 → 23.9.15
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/app.js +4 -0
- package/package.json +2 -3
- package/yield.js +0 -23
package/app.js
CHANGED
|
@@ -556,6 +556,10 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
556
556
|
resourceLimits,
|
|
557
557
|
utilization: performance.eventLoopUtilization?.(elu2, elu1),
|
|
558
558
|
heap: v8.getHeapStatistics(),
|
|
559
|
+
http: {
|
|
560
|
+
userAgent,
|
|
561
|
+
pending: globalThis._nxt_lib_http_pending.size,
|
|
562
|
+
},
|
|
559
563
|
}
|
|
560
564
|
}),
|
|
561
565
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/lib",
|
|
3
|
-
"version": "23.9.
|
|
3
|
+
"version": "23.9.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,7 @@
|
|
|
44
44
|
"transcript.js",
|
|
45
45
|
"docker-secrets.js",
|
|
46
46
|
"wordwrap.js",
|
|
47
|
-
"under-pressure.js"
|
|
48
|
-
"yield.js"
|
|
47
|
+
"under-pressure.js"
|
|
49
48
|
],
|
|
50
49
|
"scripts": {
|
|
51
50
|
"prepublishOnly": "pinst --disable",
|
package/yield.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
let yieldTime = performance.now()
|
|
2
|
-
|
|
3
|
-
export function maybeYield(opts) {
|
|
4
|
-
const timeout = opts?.timeout ?? 50
|
|
5
|
-
if (performance.now() - yieldTime > timeout) {
|
|
6
|
-
return doYield(opts)
|
|
7
|
-
}
|
|
8
|
-
opts?.signal?.throwIfAborted()
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function doYield(opts) {
|
|
12
|
-
await new Promise((resolve) => setImmediate(resolve))
|
|
13
|
-
resetYield(opts)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function resetYield(opts) {
|
|
17
|
-
yieldTime = performance.now()
|
|
18
|
-
opts?.signal?.throwIfAborted()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
setInterval(() => {
|
|
22
|
-
yieldTime = performance.now()
|
|
23
|
-
}, 500).unref()
|