SetFinalizer sets a function to be called when a value drops out of the cache
(finalize func(any))
| 256 | |
| 257 | // SetFinalizer sets a function to be called when a value drops out of the cache |
| 258 | func (c *Cache) SetFinalizer(finalize func(any)) { |
| 259 | c.mu.Lock() |
| 260 | c.finalize = finalize |
| 261 | c.mu.Unlock() |
| 262 | } |
| 263 | |
| 264 | // EntriesWithPinCount returns the number of pinned and unpinned entries in the cache |
| 265 | // |