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

Method unref

transport.go:325–337  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

323}
324
325func (p *connPool) unref() {
326 if atomic.AddUintptr(&p.refc, ^uintptr(0)) == 0 {
327 p.mutex.Lock()
328 defer p.mutex.Unlock()
329
330 for _, conns := range p.conns {
331 conns.closeIdleConns()
332 }
333
334 p.ctrl.closeIdleConns()
335 p.cancel()
336 }
337}
338
339func (p *connPool) roundTrip(ctx context.Context, req Request) (Response, error) {
340 // This first select should never block after the first metadata response

Callers 2

CloseIdleConnectionsMethod · 0.45
RoundTripMethod · 0.45

Calls 1

closeIdleConnsMethod · 0.80

Tested by

no test coverage detected