MCPcopy
hub / github.com/dropbox/godropbox / GetMultiple

Method GetMultiple

container/concurrent/lrucache.go:53–68  ·  view source on GitHub ↗
(keys []string)

Source from the content-addressed store, hash-verified

51}
52
53func (p *concurrentLruCacheImp) GetMultiple(keys []string) []CacheResult {
54 // the LRU cache get alters the cache. Therefore, we should
55 // acquire the write lock and not the read lock
56 p.lock.Lock()
57 defer p.lock.Unlock()
58
59 res := make([]CacheResult, len(keys))
60
61 for i, key := range keys {
62 val, found := p.cache.Get(key)
63 res[i].V = val
64 res[i].Found = found
65 }
66
67 return res
68}
69
70func (p *concurrentLruCacheImp) Set(key string, value interface{}) {
71 p.lock.Lock()

Callers 1

GetMethod · 0.95

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected