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

Method cancel

internal/pool/want_conn.go:40–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func (w *wantConn) cancel() *Conn {
41 w.mu.Lock()
42 var cn *Conn
43 if w.done {
44 select {
45 case result := <-w.result:
46 cn = result.cn
47 default:
48 }
49 } else {
50 close(w.result)
51 }
52
53 w.done = true
54 w.ctx = nil
55 w.mu.Unlock()
56
57 return cn
58}
59
60func (w *wantConn) isOngoing() bool {
61 w.mu.RLock()

Calls

no outgoing calls