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

Method Get

internal/pool/pool.go:811–813  ·  view source on GitHub ↗

Get returns existed connection from the pool or creates a new one.

(ctx context.Context)

Source from the content-addressed store, hash-verified

809
810// Get returns existed connection from the pool or creates a new one.
811func (p *ConnPool) Get(ctx context.Context) (*Conn, error) {
812 return p.getConn(ctx)
813}
814
815// getConn returns a connection from the pool.
816func (p *ConnPool) getConn(ctx context.Context) (cn *Conn, err error) {

Calls 1

getConnMethod · 0.95

Tested by 10

BenchmarkPoolGetPutFunction · 0.76
TestDoubleFreeTurnBugFunction · 0.76
TestDoubleFreeTurnSimpleFunction · 0.76
BenchmarkPoolGetPutFunction · 0.76
BenchmarkPoolGetRemoveFunction · 0.76