(pool Pooler)
| 46 | var _ Pooler = (*StickyConnPool)(nil) |
| 47 | |
| 48 | func 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 | |
| 60 | func (p *StickyConnPool) NewConn(ctx context.Context) (*Conn, error) { |
| 61 | return p.pool.NewConn(ctx) |