LifetimeFilterOptions

export interface LifetimeFilterOptions<K, V>
export interface LifetimeFilterOptions<K, V>
Options for generating a filter function based on lifetime
NameConstraintsOptionalDefaultDescription
KNoNone
VNoNone
excludeFromSweep?:(value: V, key: K, collection: LimitedCollection<K, V>) => boolean
A function that takes an entry, key, and the collection and returns a boolean, true when the entry should not be checked for sweepability.
getComparisonTimestamp?:(value: V, key: K, collection: LimitedCollection<K, V>) => number
A function that takes an entry, key, and the collection and returns a timestamp to compare against in order to determine the lifetime of the entry.
lifetime?:number
How long, in seconds, an entry should stay in the collection before it is considered sweepable.