(ctx context.Context, network string, addr string, channels []string)
| 34 | } |
| 35 | |
| 36 | func (p *PubSubPool) NewConn(ctx context.Context, network string, addr string, channels []string) (*Conn, error) { |
| 37 | if p.closed.Load() { |
| 38 | return nil, ErrClosed |
| 39 | } |
| 40 | |
| 41 | netConn, err := p.netDialer(ctx, network, addr) |
| 42 | if err != nil { |
| 43 | return nil, err |
| 44 | } |
| 45 | cn := NewConnWithBufferSize(netConn, p.opt.ReadBufferSize, p.opt.WriteBufferSize) |
| 46 | cn.pubsub = true |
| 47 | // Set pool name for metrics |
| 48 | cn.SetPoolName(p.opt.Name) |
| 49 | atomic.AddUint32(&p.stats.Created, 1) |
| 50 | return cn, nil |
| 51 | } |
| 52 | |
| 53 | func (p *PubSubPool) TrackConn(cn *Conn) { |
| 54 | atomic.AddUint32(&p.stats.Active, 1) |
nothing calls this directly
no test coverage detected