Table of Contents

EvictingDictionaryExpirationKind Enum

Definition

Namespace
Bodu.Collections.Generic
Assembly
Bodu.Collections.dll
Package
Bodu.Collections 1.3.0
Source
EvictingDictionaryExpirationKind.cs

Specifies how an EvictingDictionary<TKey, TValue> measures an entry's time-to-live when expiration is configured through EvictingDictionaryExpiration.

public enum EvictingDictionaryExpirationKind
Extension Methods

Fields

Absolute = 0

The entry expires a fixed interval after it was added or last updated; read accesses do not extend its lifetime.

Sliding = 1

The entry's expiration deadline is refreshed on every successful read access ( TryGetValue or the indexer getter), so the entry expires only after remaining unread for its full time-to-live.

Remarks

The kind determines the point from which an entry's time-to-live is counted. Under Absolute the countdown starts when the entry is added (or its value is updated) and is unaffected by reads. Under Sliding every successful read that returns the value - TryGetValue(TKey, out TValue) and the indexer getter - restarts the countdown, keeping actively read entries alive indefinitely.

ContainsKey(TKey), Touch(TKey), and enumeration never refresh an entry's lifetime under either kind.

Applies to

ProductVersions
.NET8, 10