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

Function NewStickyConnPool

internal/pool/pool_sticky.go:48–58  ·  view source on GitHub ↗
(pool Pooler)

Source from the content-addressed store, hash-verified

46var _ Pooler = (*StickyConnPool)(nil)
47
48func NewStickyConnPool(pool Pooler) *StickyConnPool {
49 p, ok := pool.(*StickyConnPool)
50 if !ok {
51 p = &StickyConnPool{
52 pool: pool,
53 ch: make(chan *Conn, 1),
54 }
55 }
56 atomic.AddInt32(&p.shared, 1)
57 return p
58}
59
60func (p *StickyConnPool) NewConn(ctx context.Context) (*Conn, error) {
61 return p.pool.NewConn(ctx)

Callers 2

ConnMethod · 0.92
newTxMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected