Class RandomEvictionCache<TValue>
A client cache implementation that evicts a random entry when capacity is exceeded.
public class RandomEvictionCache<TValue> : ClientCache<TValue>
Type Parameters
TValue
Type of value.
- Inheritance
-
ClientCache<TValue>RandomEvictionCache<TValue>
- Inherited Members
Constructors
- RandomEvictionCache(int)
Constructor.
Properties
- Capacity
Gets the maximum number of elements in the cache.
- Count
Gets the number of elements in the cache.
Methods
- Get(ref ObjectKey)
Returns the CacheEntry<TValue> associated with the provided key, or
null
if not found.
- Remove(ref ObjectKey)
Removes the value with the specified key from the client cache.
- Set(ref ObjectKey, CacheEntry<TValue>)
Creates/Updates the client cache with latest version of object.
- Touch(ref ObjectKey)
Update the age of the client cache entry to the current time. Called after a round trip to the service confirms that the entry is up-to-date.