Interface IContentCache
- Namespace
- Homa.Sdk.Foundation
- Assembly
- Homa.Sdk.Foundation.dll
Used to store content based on an ID, to retrieve later.
public interface IContentCache
Methods
Clear()
Removes all cached content from the cache.
Task Clear()
Returns
Initialize()
Initializes the content cache.
Task Initialize()
Returns
Prune(CancellationToken)
Removes outdated content.
Task Prune(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token to use for that task.
Returns
RemoveContent(string)
Removes the content associated to the given ID in the cache.
Task<bool> RemoveContent(string id)
Parameters
idstringThe ID of the content to remove.
Returns
RetrieveContent(string, CancellationToken)
Gets content associated to the given ID from the cache.
Task<string> RetrieveContent(string id, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the content to fetch.
cancellationTokenCancellationTokenThe cancellation token to use for that task.
Returns
StoreContent(string, string, CancellationToken)
Sets the content associated to the given ID in the cache.
Task StoreContent(string id, string content, CancellationToken cancellationToken = default)
Parameters
idstringThe ID of the content to store.
contentstringThe content to store in the cache.
cancellationTokenCancellationTokenThe cancellation token to use for that task.