Cache is a concurrent size-limited cache. If the cache size reaches maxCacheEntries all existing entries are removed. maxCacheEntries should effectively be the number of workers in the topology, but rather than expose that information to filters we for now just use an estimated max of 100.
| 12 | // topology, but rather than expose that information to filters we for |
| 13 | // now just use an estimated max of 100. |
| 14 | type Cache struct { |
| 15 | cache sync.Map |
| 16 | |
| 17 | mx sync.Mutex |
| 18 | nentries int64 |
| 19 | } |
| 20 | |
| 21 | // Store caches key and value in the cache. |
| 22 | func (c *Cache) Store(key, value interface{}) { |
nothing calls this directly
no outgoing calls
no test coverage detected