MCPcopy
hub / github.com/segmentio/kafka-go / CloseIdleConnections

Method CloseIdleConnections

transport.go:135–146  ·  view source on GitHub ↗

CloseIdleConnections closes all idle connections immediately, and marks all connections that are in use to be closed when they become idle again.

()

Source from the content-addressed store, hash-verified

133// CloseIdleConnections closes all idle connections immediately, and marks all
134// connections that are in use to be closed when they become idle again.
135func (t *Transport) CloseIdleConnections() {
136 t.mutex.Lock()
137 defer t.mutex.Unlock()
138
139 for _, pool := range t.pools {
140 pool.unref()
141 }
142
143 for k := range t.pools {
144 delete(t.pools, k)
145 }
146}
147
148// RoundTrip sends a request to a kafka cluster and returns the response, or an
149// error if no responses were received.

Callers 6

newClientFunction · 0.95
newClientFunction · 0.95
newClientFunction · 0.95
CloseMethod · 0.80

Calls 1

unrefMethod · 0.45

Tested by 5

newClientFunction · 0.76
newClientFunction · 0.76
newClientFunction · 0.76