MCPcopy
hub / github.com/aceld/zinx / IterCb

Method IterCb

zutils/shard_lock_map.go:429–438  ·  view source on GitHub ↗

IterCb Callback based iterator, cheapest way to read all elements in a map.

(fn IterCb)

Source from the content-addressed store, hash-verified

427// IterCb Callback based iterator, cheapest way to read
428// all elements in a map.
429func (slm ShardLockMaps) IterCb(fn IterCb) {
430 for idx := range slm.shards {
431 shard := (slm.shards)[idx]
432 shard.RLock()
433 for key, value := range shard.items {
434 fn(key, value)
435 }
436 shard.RUnlock()
437 }
438}
439
440// MarshalJSON Reviles ConcurrentMap "private" variables to json marshal.
441func (slm ShardLockMaps) MarshalJSON() ([]byte, error) {

Callers 5

TestIterCbFunction · 0.95
NotifyAllMethod · 0.80
NotifyBuffAllMethod · 0.80
RangeMethod · 0.80
Range2Method · 0.80

Calls

no outgoing calls

Tested by 1

TestIterCbFunction · 0.76