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

Method discardDoneAtFront

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

Source from the content-addressed store, hash-verified

99}
100
101func (q *wantConnQueue) discardDoneAtFront() int {
102 q.mu.Lock()
103 defer q.mu.Unlock()
104 count := 0
105 for len(q.items) > 0 {
106 if q.items[0].isOngoing() {
107 break
108 }
109
110 q.items = q.items[1:]
111 count++
112 }
113
114 return count
115}

Calls 1

isOngoingMethod · 0.80