Sends heartbeats and closes idle connections on one shared interval.
HeartbeatSweeper(runtime: IRuntimeServices,options: HeartbeatOptions,connections: () => Iterable<WebSocketConnection>)
Creates the sweeper.
Parameters
options: HeartbeatOptions
Heartbeat configuration
connections: () => Iterable<WebSocketConnection>
Supplies the current connections on each tick
readonly
isRunning: boolean
Whether the interval is currently running.
start(): void
Starts the interval. A no-op when heartbeats are disabled, so a plugin left at its defaults never creates a timer.
stop(): void
Stops the interval. Idempotent.
tick(): void
Runs one sweep: closes connections that have been silent too long, then sends the heartbeat payload to the rest.
Exposed so tests drive a deterministic tick rather than waiting on a timer.