TokenInMemoryCacheTKey, TValue - класс

Represents an in-memory cache for tokens. It also supports automatic cleanup of tokens.

Definition

Пространство имён: Tessa.Tokens.Caching
Сборка: Tessa (в Tessa.dll) Версия: 4.1.3+7e2b1422f9b8c7c41fbbc4b151a843bed05319ab
C#
public class TokenInMemoryCache<TKey, TValue> : ITokenCache<TKey, TValue>
Inheritance
Object    TokenInMemoryCacheTKey, TValue
Derived
Implements
ITokenCacheTKey, TValue

Параметры типа

TKey
TValue

Конструкторы

TokenInMemoryCacheTKey, TValue Represents an in-memory cache for tokens. It also supports automatic cleanup of tokens.

Свойства

CacheMap Cached values.
CleanupPredicate A predicate function used to determine whether a cache entry should be removed during cleanup, or null, if all cached entries can be cleaned up.
Clock Объект для предоставления текущего времени в формате Utc.
GetCleanupPeriodFunc Period after which tokens should be removed from the cache.
Allowed values:
  • < 0 – no automatic cleanup will occur;
  • 0 – cleaning each time the token is received;
  • > 0 – cleaning at specified intervals.
LastCleanup Date/time of last cleanup in UTC.

Методы

Cleanup Performs cleanup of cache entries, if necessary.
Clear Clears the cache and resets its state, removing all entries.
EqualsDetermines whether the specified object is equal to the current object.
(Унаследован от Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Унаследован от Object)
GetHashCodeServes as the default hash function.
(Унаследован от Object)
GetTypeGets the Type of the current instance.
(Унаследован от Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Унаследован от Object)
ReleaseCleanupLock Releases a lock for cleaning up the cache.
ToStringReturns a string that represents the current object.
(Унаследован от Object)
TryAcquireCleanupLock Attempts to acquire a lock for cleaning up the cache if it hasn't already been acquired.
TryAddOrUpdate Attempts to add or update the cache value associated with the specified key.
TryGet(FuncTKey, TValue, Boolean, TValue) Attempts to retrieve the cache value that matches the specified condition.
TryGet(TKey, TValue) Attempts to retrieve the cache value associated with the specified key.
TryRemove(FuncTKey, TValue, Boolean, TValue) Attempts to remove the cache value that matches the specified condition.
TryRemove(TKey, TValue) Attempts to remove the cache value associated with the specified key.
TryUpdate Attempts to update the cache value that matches the specified condition.

См. также