MCPcopy
hub / github.com/rclone/rclone / SetFinalizer

Method SetFinalizer

lib/cache/cache.go:258–262  ·  view source on GitHub ↗

SetFinalizer sets a function to be called when a value drops out of the cache

(finalize func(any))

Source from the content-addressed store, hash-verified

256
257// SetFinalizer sets a function to be called when a value drops out of the cache
258func (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//

Callers 3

TestCacheFinalizeFunction · 0.80
createOnFirstUseFunction · 0.80
PinUntilFinalizedFunction · 0.80

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by 1

TestCacheFinalizeFunction · 0.64