Interface ITenantDataCache
- Namespace
- GroupeIsa.Neos.ClusterCommunication.Multitenant
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Provides a memory cache for tenant data using weak references to avoid excessive memory consumption.
public interface ITenantDataCache
Methods
Clear()
Clears all entries from the cache.
void Clear()
GetKeys()
Gets all keys currently in the cache, removing any entries with dead weak references.
IEnumerable<string> GetKeys()
Returns
- IEnumerable<string>
An enumerable of cache keys.
Remove(string)
Removes a specific entry from the cache.
void Remove(string key)
Parameters
keystringThe cache key to remove.
Set<T>(string, T)
Sets a value in the cache.
void Set<T>(string key, T value) where T : class
Parameters
keystringThe cache key.
valueTThe value to cache.
Type Parameters
TThe type of the value to cache.
TryGet<T>(string, out T?)
Tries to get a value from the cache.
bool TryGet<T>(string key, out T? value) where T : class
Parameters
keystringThe cache key.
valueTThe cached value if found and alive; otherwise, null.
Returns
- bool
True if the value was found and alive; otherwise, false.
Type Parameters
TThe type of the value to retrieve.