Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
docs: document TrimOpenConns
Browse files Browse the repository at this point in the history
Co-Authored-By: Raúl Kripalani <[email protected]>
  • Loading branch information
Stebalien and raulk committed Dec 11, 2019
1 parent b171970 commit 18a536e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions connmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ type peerInfo struct {
// pruning those peers with the lowest scores first, as long as they are not within their
// grace period.
//
// TODO: error return value so we can cleanly signal we are aborting because:
// (a) there's another trim in progress, or (b) the silence period is in effect.
// This function blocks until a trim is completed. If a trim is underway, a new
// one won't be started, and instead it'll wait until that one is completed before
// returning.
func (cm *BasicConnMgr) TrimOpenConns(ctx context.Context) {
// TODO: error return value so we can cleanly signal we are aborting because:
// (a) there's another trim in progress, or (b) the silence period is in effect.

// Trigger a trim.
ch := make(chan struct{})
select {
Expand Down

0 comments on commit 18a536e

Please sign in to comment.