feat(gateway): add configurable lane queue mode, cap, and overflow
This commit is contained in:
@@ -6,6 +6,7 @@ import { serveStatic } from './static.js';
|
||||
import { SessionBridge } from './session-bridge.js';
|
||||
import type { SessionBridgeConfig } from './session-bridge.js';
|
||||
import { LaneQueue } from './lane-queue.js';
|
||||
import type { LaneQueueConfig } from './lane-queue.js';
|
||||
import { MetricsCollector } from './metrics.js';
|
||||
import { authenticateRequest } from './auth.js';
|
||||
import type { AuthConfig } from './auth.js';
|
||||
@@ -84,6 +85,7 @@ export interface GatewayServerConfig {
|
||||
maxViolations?: number;
|
||||
violationWindowMs?: number;
|
||||
};
|
||||
queue?: Partial<LaneQueueConfig>;
|
||||
/** Optional pairing manager for DM pairing code management via gateway. */
|
||||
pairingManager?: PairingManager;
|
||||
memoryStore?: MemoryStore;
|
||||
@@ -143,7 +145,7 @@ export class GatewayServer {
|
||||
memoryStore: config.memoryStore,
|
||||
});
|
||||
|
||||
this.laneQueue = new LaneQueue();
|
||||
this.laneQueue = new LaneQueue(config.queue);
|
||||
this.metrics = new MetricsCollector({
|
||||
getQueueDepth: () => this.laneQueue.totalPending(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user