MCPcopy Index your code
hub / github.com/coder/coder / HeartbeatClose

Function HeartbeatClose

coderd/httpapi/websocket.go:20–22  ·  view source on GitHub ↗

HeartbeatClose loops to ping a WebSocket to keep it alive. It calls `exit` on ping failure.

(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn)

Source from the content-addressed store, hash-verified

18// HeartbeatClose loops to ping a WebSocket to keep it alive.
19// It calls `exit` on ping failure.
20func HeartbeatClose(ctx context.Context, logger slog.Logger, exit func(), conn *websocket.Conn) {
21 heartbeatCloseWith(ctx, logger, exit, conn, quartz.NewReal(), HeartbeatInterval)
22}
23
24// HeartbeatCloseWithClock is like HeartbeatClose, but uses the provided
25// clock so tests can drive heartbeat ticks deterministically.

Callers 15

followMethod · 0.92
workspaceAgentLogsMethod · 0.92
tailnetRPCConnMethod · 0.92
watchChatsMethod · 0.92
watchChatGitMethod · 0.92
watchChatDesktopMethod · 0.92
streamChatMethod · 0.92
workspaceAgentPTYMethod · 0.92

Calls 1

heartbeatCloseWithFunction · 0.85

Tested by

no test coverage detected