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

Method NewConn

internal/pool/pool.go:579–581  ·  view source on GitHub ↗

NewConn creates a new connection and returns it to the user. This will still obey MaxActiveConns but will not include it in the pool and won't increase the pool size. NOTE: If you directly get a connection from the pool, it won't be pooled and won't support maintnotifications upgrades.

(ctx context.Context)

Source from the content-addressed store, hash-verified

577//
578// NOTE: If you directly get a connection from the pool, it won't be pooled and won't support maintnotifications upgrades.
579func (p *ConnPool) NewConn(ctx context.Context) (*Conn, error) {
580 return p.newConn(ctx, false)
581}
582
583func (p *ConnPool) newConn(ctx context.Context, pooled bool) (*Conn, error) {
584 if p.closed() {

Callers 1

Calls 1

newConnMethod · 0.95

Tested by 1