From fd7c37ac02ea56b4f791dd175c1d315b4c682c91 Mon Sep 17 00:00:00 2001 From: vnugent Date: Mon, 6 Mar 2023 01:53:33 -0500 Subject: FBM and caching non-breaking updates --- lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs') diff --git a/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs b/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs index eeee9e2..5880192 100644 --- a/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs +++ b/lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Data.Caching @@ -64,5 +64,27 @@ namespace VNLib.Data.Caching /// A token to cancel the async operation /// A task that completes when the delete operation has compelted Task DeleteAsync(string key, CancellationToken cancellation); + + /// + /// Asynchronously gets a value from the backing cache store + /// + /// + /// The key identifying the object to recover from cache + /// The specific deserialzer to deserialze the object + /// A token to cancel the async operation + /// The value if found, or null if it does not exist in the store + Task GetAsync(string key, ICacheObjectDeserialzer deserializer, CancellationToken cancellation); + + /// + /// Asynchronously sets (or updates) a cached value in the backing cache store + /// + /// + /// The key identifying the object to recover from cache + /// An optional key that will be changed for the new object + /// A token to cancel the async operation + /// The value to set at the given key + /// The used to serialze the entity + /// A task that completes when the update operation has compelted + Task AddOrUpdateAsync(string key, string? newKey, T value, ICacheObjectSerialzer serialzer, CancellationToken cancellation); } } \ No newline at end of file -- cgit