public class TokenInMemoryLruCache<TKey, TValue> : ITokenCache<TKey, TValue>
Public Class TokenInMemoryLruCache(Of TKey, TValue)
Implements ITokenCache(Of TKey, TValue)generic<typename TKey, typename TValue>
public ref class TokenInMemoryLruCache : ITokenCache<TKey, TValue>type TokenInMemoryLruCache<'TKey, 'TValue> =
class
interface ITokenCache<'TKey, 'TValue>
end| TokenInMemoryLruCacheTKey, TValue | Represents an in-memory Least Recently Used (LRU) cache for tokens. This cache automatically removes the least recently used tokens when the capacity is exceeded. It also supports automatic cleanup of tokens, based on a configurable cleanup period. |
| Cleanup | Performs cleanup of cache entries, if necessary. |
| Clear | Clears the cache and resets its state, removing all entries. |
| Equals | Determines whether the specified object is equal to the current object. (Унаследован от Object) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Унаследован от Object) |
| GetHashCode | Serves as the default hash function. (Унаследован от Object) |
| GetType | Gets the Type of the current instance. (Унаследован от Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Унаследован от Object) |
| ReleaseCleanupLock | Releases a lock for cleaning up the cache. |
| ToString | Returns 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. |
| CacheList | A doubly linked list that stores the keys in the order of usage. The most recently used key is moved to the front, while the least recently used is at the end. This is used to efficiently remove the least recently used (LRU) token when the cache reaches its capacity. |
| CacheLock | The object used to synchronize access to the cache. Ensures thread safety for operations that modify the cache, such as adding, removing, and cleaning up entries. |
| CacheMap | Cached values. |
| Capacity | The maximum number of tokens that the cache can store. When the cache exceeds this capacity, the least recently used (LRU) entry will be removed. |
| 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:
|
| LastCleanup | Date/time of last cleanup in UTC. |