Manages periodic background tasks for session maintenance.
Responsibilities:
Timers are configured at construction and use .unref() to not prevent Node.js process exit.
.unref()
For stdio mode, pass cleanupIntervalMs: 0 and keepAliveIntervalMs: 0 to disable all background tasks.
cleanupIntervalMs: 0
keepAliveIntervalMs: 0
const housekeeper = new SessionHousekeeper(store, { timeoutMs: 30 * 60_000, cleanupIntervalMs: 60_000, keepAliveIntervalMs: 30_000, maxMissedHeartbeats: 3,});// Later during shutdown:housekeeper.dispose(); Copy
const housekeeper = new SessionHousekeeper(store, { timeoutMs: 30 * 60_000, cleanupIntervalMs: 60_000, keepAliveIntervalMs: 30_000, maxMissedHeartbeats: 3,});// Later during shutdown:housekeeper.dispose();
Stops all background timers and marks as disposed.
Manages periodic background tasks for session maintenance.
Responsibilities:
Timers are configured at construction and use
.unref()to not prevent Node.js process exit.For stdio mode, pass
cleanupIntervalMs: 0andkeepAliveIntervalMs: 0to disable all background tasks.Example