@blaxel/core 0.2.83-preview.150 → 0.2.83
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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/common/h2fetch.js +31 -11
- package/dist/cjs/common/h2ref.js +33 -0
- package/dist/cjs/common/h2warm.js +4 -3
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs/types/common/h2ref.d.ts +3 -0
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/h2ref.js +33 -0
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/types/common/h2ref.d.ts +3 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/h2fetch.js +31 -11
- package/dist/esm/common/h2ref.js +29 -0
- package/dist/esm/common/h2warm.js +4 -3
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/h2ref.js +29 -0
- package/dist/esm-browser/common/settings.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const idleUnrefSessions = new WeakSet();
|
|
2
|
+
const activeRequestCounts = new WeakMap();
|
|
3
|
+
export function markH2SessionIdleUnref(session) {
|
|
4
|
+
idleUnrefSessions.add(session);
|
|
5
|
+
if ((activeRequestCounts.get(session) ?? 0) === 0) {
|
|
6
|
+
session.unref();
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function refH2SessionForActiveRequest(session) {
|
|
10
|
+
if (!idleUnrefSessions.has(session))
|
|
11
|
+
return () => { };
|
|
12
|
+
const previousActiveRequests = activeRequestCounts.get(session) ?? 0;
|
|
13
|
+
activeRequestCounts.set(session, previousActiveRequests + 1);
|
|
14
|
+
if (previousActiveRequests === 0)
|
|
15
|
+
session.ref();
|
|
16
|
+
let released = false;
|
|
17
|
+
return () => {
|
|
18
|
+
if (released)
|
|
19
|
+
return;
|
|
20
|
+
released = true;
|
|
21
|
+
const activeRequests = activeRequestCounts.get(session);
|
|
22
|
+
if (activeRequests === undefined || activeRequests <= 1) {
|
|
23
|
+
activeRequestCounts.delete(session);
|
|
24
|
+
session.unref();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
activeRequestCounts.set(session, activeRequests - 1);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -5,8 +5,8 @@ import { authentication } from "../authentication/index.js";
|
|
|
5
5
|
import { env } from "../common/env.js";
|
|
6
6
|
import { fs, os, path } from "../common/node.js";
|
|
7
7
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
8
|
-
const BUILD_VERSION = "0.2.83
|
|
9
|
-
const BUILD_COMMIT = "
|
|
8
|
+
const BUILD_VERSION = "0.2.83";
|
|
9
|
+
const BUILD_COMMIT = "d6f07458e0f766e5ef3c547eec3b0e00cf3297f7";
|
|
10
10
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
11
11
|
const BLAXEL_API_VERSION = "2026-04-16";
|
|
12
12
|
// Cache for config.yaml tracking value
|