Table of Contents

Interface IReadOnlyLifetimeCache<TKey, TValue>

Namespace
LfrlAnvil.Chrono.Caching
Assembly
LfrlAnvil.Chrono.dll

Represents a generic read-only cache of keyed entries with a limited lifetime.

public interface IReadOnlyLifetimeCache<TKey, TValue> : IReadOnlyCache<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable where TKey : notnull

Type Parameters

TKey

Entry key (identifier) type.

TValue

Entry value type.

Inherited Members

Remarks

Reading entries resets their lifetime.

Properties

CurrentTimestamp

Timestamp at which this cache currently is.

Timestamp CurrentTimestamp { get; }

Property Value

Timestamp

Lifetime

Lifetime of added entries.

Duration Lifetime { get; }

Property Value

Duration

StartTimestamp

Timestamp of the creation of this cache.

Timestamp StartTimestamp { get; }

Property Value

Timestamp

Methods

GetRemainingLifetime(TKey)

Gets the remaining lifetime of an entry with the specified key.

[Pure]
Duration GetRemainingLifetime(TKey key)

Parameters

key TKey

Key to check.

Returns

Duration

Entry's lifetime or Zero when key does not exist.