MCPcopy Create free account
hub / github.com/Super-long/ChubbyGo / IterBuffered

Method IterBuffered

BaseServer/concurrentHashMap.go:200–209  ·  view source on GitHub ↗

Returns a buffered iterator which could be used in a for range loop. 相当于所有的值都缓存在channel中

()

Source from the content-addressed store, hash-verified

198// Returns a buffered iterator which could be used in a for range loop.
199// 相当于所有的值都缓存在channel中
200func (m ConcurrentHashMap) IterBuffered() <-chan Tuple {
201 chans := snapshot(m)
202 total := 0
203 for _, c := range chans {
204 total += cap(c)
205 }
206 ch := make(chan Tuple, total)
207 go fanIn(chans, ch)
208 return ch
209}
210
211// Returns a array of channels that contains elements in each shard,
212// which likely takes a snapshot of `m`.

Callers 2

ItemsMethod · 0.95
MarshalJSONMethod · 0.95

Calls 2

snapshotFunction · 0.85
fanInFunction · 0.85

Tested by

no test coverage detected