feat(gateway): add configurable lane queue mode, cap, and overflow

This commit is contained in:
William Valentin
2026-02-16 11:48:45 -08:00
parent 527602fd8a
commit f7284a4ef1
9 changed files with 178 additions and 5 deletions
+11
View File
@@ -32,6 +32,15 @@ const wsRateLimitSchema = z.object({
violation_window_ms: z.number().min(1000).max(60000).default(10000),
}).default({});
const laneQueueSchema = z.object({
/** Queue behavior for concurrent requests in the same session lane. */
mode: z.enum(['collect', 'steer', 'interrupt']).default('collect'),
/** Max queued (pending) requests per lane. */
cap: z.number().min(1).max(1000).default(50),
/** Overflow strategy when cap is reached. */
overflow: z.enum(['drop_old', 'drop_new']).default('drop_old'),
}).default({});
const serverDiscoverySchema = z.object({
/** Enable local-network service discovery (mDNS/Bonjour advertisement). */
enabled: z.boolean().default(false),
@@ -59,6 +68,8 @@ const serverSchema = z.object({
max_request_body_bytes: z.number().min(1024).max(10 * 1024 * 1024).default(1_048_576),
/** Per-connection WebSocket ingress rate limit settings. */
ws_rate_limit: wsRateLimitSchema,
/** Per-session gateway lane queue behavior. */
queue: laneQueueSchema,
/** Optional Bonjour/mDNS advertisement settings. */
discovery: serverDiscoverySchema,
});