MCPcopy
hub / github.com/hashicorp/go-memdb / Add

Method Add

watch.go:21–29  ·  view source on GitHub ↗

Add appends a watchCh to the WatchSet if non-nil.

(watchCh <-chan struct{})

Source from the content-addressed store, hash-verified

19
20// Add appends a watchCh to the WatchSet if non-nil.
21func (w WatchSet) Add(watchCh <-chan struct{}) {
22 if w == nil {
23 return
24 }
25
26 if _, ok := w[watchCh]; !ok {
27 w[watchCh] = struct{}{}
28 }
29}
30
31// AddWithLimit appends a watchCh to the WatchSet if non-nil, and if the given
32// softLimit hasn't been exceeded. Otherwise, it will watch the given alternate

Callers 6

testWatchFunction · 0.95
testWatchChFunction · 0.95
TestWatchCtxLeakFunction · 0.95
BenchmarkWatchFunction · 0.95
AddWithLimitMethod · 0.95
TestWatchUpdateFunction · 0.95

Calls

no outgoing calls

Tested by 5

testWatchFunction · 0.76
testWatchChFunction · 0.76
TestWatchCtxLeakFunction · 0.76
BenchmarkWatchFunction · 0.76
TestWatchUpdateFunction · 0.76