diff options
Diffstat (limited to 'lib/VNLib.Data.Caching/src')
-rw-r--r-- | lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs b/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs index 5880192..eb782d9 100644 --- a/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs +++ b/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs @@ -83,8 +83,31 @@ namespace VNLib.Data.Caching /// <param name="newKey">An optional key that will be changed for the new object</param> /// <param name="cancellation">A token to cancel the async operation</param> /// <param name="value">The value to set at the given key</param> - /// <param name="serialzer">The <see cref="ICacheObjectSerialzer{T}"/> used to serialze the entity</param> + /// <param name="serialzer">The <see cref="ICacheObjectSerialzer"/> used to serialze the entity</param> /// <returns>A task that completes when the update operation has compelted</returns> Task AddOrUpdateAsync<T>(string key, string? newKey, T value, ICacheObjectSerialzer serialzer, CancellationToken cancellation); + + /// <summary> + /// Asynchronously gets a value from the backing cache store and writes it to the + /// supplied data buffer + /// </summary> + /// <param name="key">The key identifying the object to recover from cache</param> + /// <param name="rawData">The </param> + /// <param name="cancellation">A token to cancel the async operation</param> + /// <returns>A task that complets when the object data has been written to the data buffer</returns> + Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation); + + /// <summary> + /// Asynchronously sets (or updates) a cached value in the backing cache store + /// from the supplied raw data + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="key">The key identifying the object to recover from cache</param> + /// <param name="newKey">An optional key that will be changed for the new object</param> + /// <param name="cancellation">A token to cancel the async operation</param> + /// <param name="rawData">The raw data to store at the given key</param> + /// <param name="serialzer">The <see cref="ICacheObjectSerialzer"/> used to serialze the entity</param> + /// <returns>A task that completes when the update operation has compelted</returns> + Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation); } }
\ No newline at end of file |