From dc7ad57c845cc9b1b502e5e8b12ce96af4183dc4 Mon Sep 17 00:00:00 2001 From: vman Date: Fri, 18 Nov 2022 17:15:36 -0500 Subject: Add project files. --- VNLib.Data.Caching.Global/IGlobalCacheProvider.cs | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 VNLib.Data.Caching.Global/IGlobalCacheProvider.cs (limited to 'VNLib.Data.Caching.Global/IGlobalCacheProvider.cs') diff --git a/VNLib.Data.Caching.Global/IGlobalCacheProvider.cs b/VNLib.Data.Caching.Global/IGlobalCacheProvider.cs new file mode 100644 index 0000000..12b4b0b --- /dev/null +++ b/VNLib.Data.Caching.Global/IGlobalCacheProvider.cs @@ -0,0 +1,39 @@ + +namespace VNLib.Data.Caching.Global +{ + /// + /// An interface that a cache provoider must impelement to provide data caching to the + /// environment + /// + public interface IGlobalCacheProvider + { + /// + /// Gets a value that indicates if the cache provider is currently available + /// + public bool IsConnected { get; } + + /// + /// Asynchronously gets a value from the backing cache store + /// + /// + /// The key identifying the object to recover from cache + /// The value if found, or null if it does not exist in the store + Task GetAsync(string key); + + /// + /// Asynchronously sets (or updates) a cached value in the backing cache store + /// + /// + /// The key identifying the object to recover from cache + /// The value to set at the given key + /// A task that completes when the update operation has compelted + Task SetAsync(string key, T value); + + /// + /// Asynchronously deletes an item from cache by its key + /// + /// The key identifying the item to delete + /// A task that completes when the delete operation has compelted + Task DeleteAsync(string key); + } +} \ No newline at end of file -- cgit