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

Function NewSingleConnPool

internal/pool/pool_single.go:25–30  ·  view source on GitHub ↗

NewSingleConnPool creates a new single connection pool. The pool will always return the same connection. The pool will not: - Close the connection - Reconnect the connection - Track the connection in any way

(pool Pooler, cn *Conn)

Source from the content-addressed store, hash-verified

23// - Reconnect the connection
24// - Track the connection in any way
25func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool {
26 return &SingleConnPool{
27 pool: pool,
28 cn: cn,
29 }
30}
31
32func (p *SingleConnPool) NewConn(ctx context.Context) (*Conn, error) {
33 return p.pool.NewConn(ctx)

Callers 2

reAuthConnectionMethod · 0.92
initConnMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected