diff options
author | vnugent <public@vaughnnugent.com> | 2023-08-05 17:50:16 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-08-05 17:50:16 -0400 |
commit | bd4590d7cfaf2fa554ff6c37e095975ac4eb0f02 (patch) | |
tree | 66c4720e46cb7eb066a784a22a4de3544babbafb /lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs | |
parent | 6de8bb6b38b716605f0d275d998ca47e33520b7a (diff) |
Public prep, and api additions
Diffstat (limited to 'lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs')
-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 |