Table of Contents

EvictingDictionaryExpirationKind Enum

Definition

Namespace
Bodu.Collections.Generic
Assembly
Bodu.Collections.dll
Package
Bodu.Collections 1.0.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, the indexer getter, or ContainsKey), 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 access - TryGetValue(TKey, out TValue), the indexer getter, and ContainsKey(TKey) - restarts the countdown, keeping actively read entries alive indefinitely.

Enumeration never refreshes an entry's lifetime under either kind.

Applies to

ProductVersions
.NET8, 10