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

Function NewReAuthPoolHook

internal/auth/streaming/pool_hook.go:62–69  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

60// The poolSize parameter is used to initialize the worker semaphore, ensuring that
61// re-auth operations don't exhaust the connection pool.
62func 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//

Callers 1

NewManagerFunction · 0.85

Calls 1

NewFastSemaphoreFunction · 0.92

Tested by

no test coverage detected