(keys []string)
| 51 | } |
| 52 | |
| 53 | func (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 | |
| 70 | func (p *concurrentLruCacheImp) Set(key string, value interface{}) { |
| 71 | p.lock.Lock() |