folly::WeightedEvictingCacheMap::setPruneHook

Set the prune hook, which is the function invoked on the key and value on each eviction. An operation will throw if the pruneHook throws. Note that this prune hook is not automatically called on entries explicitly erase()ed nor on remaining entries at destruction time.

Synopsis

Declared in <folly/container/WeightedEvictingCacheMap.h>

void
setPruneHook(PruneHookCall pruneHook);

Parameters

NameDescription
pruneHookeviction callback to set as default, or nullptr to clear