HeartbeatCloseWithClock is like HeartbeatClose, but uses the provided clock so tests can drive heartbeat ticks deterministically.
(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn, clk quartz.Clock)
| 24 | // HeartbeatCloseWithClock is like HeartbeatClose, but uses the provided |
| 25 | // clock so tests can drive heartbeat ticks deterministically. |
| 26 | func HeartbeatCloseWithClock(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn, clk quartz.Clock) { |
| 27 | heartbeatCloseWith(ctx, logger, exit, conn, clk, HeartbeatInterval) |
| 28 | } |
| 29 | |
| 30 | func heartbeatCloseWith(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn, clk quartz.Clock, interval time.Duration) { |
| 31 | ticker := clk.NewTicker(interval, "HeartbeatClose") |
no test coverage detected