| 392 | } |
| 393 | |
| 394 | type 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 | |
| 425 | var _ Pooler = (*ConnPool)(nil) |
| 426 |
nothing calls this directly
no outgoing calls
no test coverage detected