From bd4590d7cfaf2fa554ff6c37e095975ac4eb0f02 Mon Sep 17 00:00:00 2001 From: vnugent Date: Sat, 5 Aug 2023 17:50:16 -0400 Subject: Public prep, and api additions --- .../src/VnCacheClient.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/VNLib.Plugins.Extensions.VNCache/src/VnCacheClient.cs') diff --git a/lib/VNLib.Plugins.Extensions.VNCache/src/VnCacheClient.cs b/lib/VNLib.Plugins.Extensions.VNCache/src/VnCacheClient.cs index b10cef7..72eecd8 100644 --- a/lib/VNLib.Plugins.Extensions.VNCache/src/VnCacheClient.cs +++ b/lib/VNLib.Plugins.Extensions.VNCache/src/VnCacheClient.cs @@ -273,7 +273,22 @@ namespace VNLib.Plugins.Extensions.VNCache ? throw new InvalidOperationException("The underlying client is not connected to a cache node") : Client!.AddOrUpdateObjectAsync(key, newKey, value, serialzer, cancellation); } - + + /// + public virtual Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation) + { + return !IsConnected + ? throw new InvalidOperationException("The underlying client is not connected to a cache node") + : Client!.GetObjectAsync(key, rawData, cancellation); + } + + /// + public virtual Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation) + { + return !IsConnected + ? throw new InvalidOperationException("The underlying client is not connected to a cache node") + : Client!.AddOrUpdateObjectAsync(key, newKey, rawData, serialzer, cancellation); + } private sealed class AuthManager : ICacheAuthManager { -- cgit