MCPcopy
hub / github.com/redis/go-redis / ConnPool

Struct ConnPool

internal/pool/pool.go:394–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394type ConnPool struct {
395 cfg *Options
396
397 dialErrorsNum uint32 // atomic
398 lastDialError atomic.Value
399
400 dialsInProgress chan struct{}
401 dialsQueue *wantConnQueue
402 // Fast semaphore for connection limiting with eventual fairness
403 // Uses fast path optimization to avoid timer allocation when tokens are available
404 semaphore *internal.FastSemaphore
405
406 connsMu sync.Mutex
407 conns map[uint64]*Conn
408 idleConns []*Conn
409
410 poolSize atomic.Int32
411 idleConnsLen atomic.Int32
412 idleCheckInProgress atomic.Bool
413 idleCheckNeeded atomic.Bool
414
415 stats Stats
416 waitDurationNs atomic.Int64
417
418 _closed uint32 // atomic
419
420 // Pool hooks manager for flexible connection processing
421 // Using atomic.Pointer for lock-free reads in hot paths (Get/Put)
422 hookManager atomic.Pointer[PoolHookManager]
423}
424
425var _ Pooler = (*ConnPool)(nil)
426

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected