MCPcopy Create free account
hub / github.com/PostHog/duckgres / initConnsMap

Method initConnsMap

server/server.go:737–742  ·  view source on GitHub ↗

initConnsMap initializes the connection registry map. This is a separate method to work around cases where a local variable named "clientConn" shadows the type name (e.g., in worker.go).

()

Source from the content-addressed store, hash-verified

735// ActiveConnections returns the number of active connections
736func (s *Server) ActiveConnections() int64 {
737 return atomic.LoadInt64(&s.activeConns)
738}
739
740// RegisterQuery registers a cancel function for a backend key.
741// This allows the query to be cancelled via a cancel request from another connection.
742func (s *Server) RegisterQuery(key BackendKey, cancel context.CancelFunc) {
743 s.activeQueriesMu.Lock()
744 // Lazily initialized: production servers get the map from New, but test
745 // fixtures (and InitMinimalServer paths) may construct a bare Server.

Callers 2

TestInitConnsMapFunction · 0.95
runChildWorkerFunction · 0.95

Calls 1

newRecentErrorRingFunction · 0.85

Tested by 1

TestInitConnsMapFunction · 0.76