@velum-labs/routekit-gateway 1.1.0 → 1.2.0
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/switching-proxy.js +4 -4
- package/package.json +7 -7
package/dist/switching-proxy.js
CHANGED
|
@@ -178,7 +178,7 @@ const startSwitchingGatewayProxyOperation = Effect.fn("SwitchingGatewayProxy.sta
|
|
|
178
178
|
waiters: new Set()
|
|
179
179
|
};
|
|
180
180
|
const generations = new Map([[active.url, active]]);
|
|
181
|
-
const
|
|
181
|
+
const requestTarget = Symbol("routekit.gateway.requestTarget");
|
|
182
182
|
let draining = false;
|
|
183
183
|
let retiring = false;
|
|
184
184
|
let inflight = 0;
|
|
@@ -207,7 +207,7 @@ const startSwitchingGatewayProxyOperation = Effect.fn("SwitchingGatewayProxy.sta
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
const selected =
|
|
210
|
+
const selected = nodeReq[requestTarget] ?? active;
|
|
211
211
|
const aborter = yield* Effect.acquireRelease(Effect.sync(() => new AbortController()), (controller) => Effect.sync(() => {
|
|
212
212
|
controller.abort(new Error("gateway client disconnected"));
|
|
213
213
|
}));
|
|
@@ -259,7 +259,7 @@ const startSwitchingGatewayProxyOperation = Effect.fn("SwitchingGatewayProxy.sta
|
|
|
259
259
|
const server = createServer((req, res) => {
|
|
260
260
|
const selected = active;
|
|
261
261
|
selected.leases += 1;
|
|
262
|
-
|
|
262
|
+
req[requestTarget] = selected;
|
|
263
263
|
if (retiring) {
|
|
264
264
|
res.shouldKeepAlive = false;
|
|
265
265
|
res.setHeader("connection", "close");
|
|
@@ -267,7 +267,7 @@ const startSwitchingGatewayProxyOperation = Effect.fn("SwitchingGatewayProxy.sta
|
|
|
267
267
|
inflight += 1;
|
|
268
268
|
res.once("close", () => {
|
|
269
269
|
inflight -= 1;
|
|
270
|
-
|
|
270
|
+
delete req[requestTarget];
|
|
271
271
|
selected.leases -= 1;
|
|
272
272
|
if (selected.leases === 0) {
|
|
273
273
|
for (const resolve of selected.waiters)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velum-labs/routekit-gateway",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/velum-labs/routekit.git",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"@aws-sdk/client-bedrock": "3.1095.0",
|
|
46
46
|
"@aws-sdk/client-bedrock-runtime": "3.1095.0",
|
|
47
47
|
"effect": "4.0.0-rc.108",
|
|
48
|
-
"@velum-labs/routekit-config-core": "1.
|
|
49
|
-
"@velum-labs/routekit-contracts": "1.
|
|
50
|
-
"@velum-labs/routekit-eval-contracts": "1.
|
|
51
|
-
"@velum-labs/routekit-eval-core": "1.
|
|
52
|
-
"@velum-labs/routekit-registry": "1.
|
|
53
|
-
"@velum-labs/routekit-runtime": "1.
|
|
48
|
+
"@velum-labs/routekit-config-core": "1.2.0",
|
|
49
|
+
"@velum-labs/routekit-contracts": "1.2.0",
|
|
50
|
+
"@velum-labs/routekit-eval-contracts": "1.2.0",
|
|
51
|
+
"@velum-labs/routekit-eval-core": "1.2.0",
|
|
52
|
+
"@velum-labs/routekit-registry": "1.2.0",
|
|
53
|
+
"@velum-labs/routekit-runtime": "1.2.0"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"routekit",
|