NewReAuthPoolHook creates a new re-authentication pool hook. Parameters: - poolSize: Maximum number of concurrent re-auth operations (typically matches pool size) - reAuthTimeout: Maximum time to wait for acquiring a connection for re-authentication The poolSize parameter is used to initialize the
(poolSize int, reAuthTimeout time.Duration)
| 60 | // The poolSize parameter is used to initialize the worker semaphore, ensuring that |
| 61 | // re-auth operations don't exhaust the connection pool. |
| 62 | func NewReAuthPoolHook(poolSize int, reAuthTimeout time.Duration) *ReAuthPoolHook { |
| 63 | return &ReAuthPoolHook{ |
| 64 | shouldReAuth: make(map[uint64]func(error)), |
| 65 | scheduledReAuth: make(map[uint64]bool), |
| 66 | workers: internal.NewFastSemaphore(int32(poolSize)), |
| 67 | reAuthTimeout: reAuthTimeout, |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | // MarkForReAuth marks a connection for re-authentication. |
| 72 | // |
no test coverage detected