aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-08-05 17:50:16 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-08-05 17:50:16 -0400
commitbd4590d7cfaf2fa554ff6c37e095975ac4eb0f02 (patch)
tree66c4720e46cb7eb066a784a22a4de3544babbafb /lib
parent6de8bb6b38b716605f0d275d998ca47e33520b7a (diff)
Public prep, and api additions
Diffstat (limited to 'lib')
-rw-r--r--lib/VNLib.Data.Caching.Extensions/LICENSE.txt4
-rw-r--r--lib/VNLib.Data.Caching.Extensions/README.md16
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/LICENSE.txt4
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/README.md17
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/src/BlobCache.cs2
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/src/CacheBucketHandle.cs2
-rw-r--r--lib/VNLib.Data.Caching/LICENSE.txt4
-rw-r--r--lib/VNLib.Data.Caching/README.md15
-rw-r--r--lib/VNLib.Data.Caching/src/IGlobalCacheProvider.cs25
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/LICENSE.txt4
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/README.md14
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/EntityCacheExtensions.cs30
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/ScopedCache.cs6
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/src/MemoryCache.cs28
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/src/RemoteBackedMemoryCache.cs49
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/src/VnCacheClient.cs17
-rw-r--r--lib/VNLib.Plugins.Extensions.VNCache/src/VnGlobalCache.cs12
17 files changed, 221 insertions, 28 deletions
diff --git a/lib/VNLib.Data.Caching.Extensions/LICENSE.txt b/lib/VNLib.Data.Caching.Extensions/LICENSE.txt
index 147bcd6..a169586 100644
--- a/lib/VNLib.Data.Caching.Extensions/LICENSE.txt
+++ b/lib/VNLib.Data.Caching.Extensions/LICENSE.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2022 Vaughn Nugent
+Copyright (c) 2023 Vaughn Nugent
Contact information
Name: Vaughn Nugent
- Email: public[at]vaughnnugent[dot]com
+ Email: vnpublic@proton.me
Website: https://www.vaughnnugent.com
The software in this repository is licensed under the GNU Affero GPL version 3.0 (or any later version).
diff --git a/lib/VNLib.Data.Caching.Extensions/README.md b/lib/VNLib.Data.Caching.Extensions/README.md
index 4326223..790f914 100644
--- a/lib/VNLib.Data.Caching.Extensions/README.md
+++ b/lib/VNLib.Data.Caching.Extensions/README.md
@@ -1,8 +1,18 @@
# VNLib.Data.Caching.Extensions
-*An extension library for rapid VNCache development*
+*An extension library for rapid VNCache distributed cache application development*
-#### Builds
-Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my [website](https://www.vaughnnugent.com/resources/software). All tar-gzip (.tgz) files will have an associated .sha384 appended checksum of the desired download file.
+### Dependency notice
+This library depends on the VNLib.Net.Rest.Client library which requires RestSharp.
+
+## Builds
+Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my website (link below).
+
+## Docs and Guides
+Documentation, specifications, and setup guides are available on my website.
+
+[Docs and Articles](https://www.vaughnnugent.com/resources/software/articles?tags=docs,_VNLib.Data.Caching.Extensions)
+[Builds and Source](https://www.vaughnnugent.com/resources/software/modules/VNLib.Data.Caching)
+[Nuget Feeds](https://www.vaughnnugent.com/resources/software/modules)
## License
Source files in for this project are licensed to you under the GNU Affero General Public License (or any later version). See the LICENSE files for more information. \ No newline at end of file
diff --git a/lib/VNLib.Data.Caching.ObjectCache/LICENSE.txt b/lib/VNLib.Data.Caching.ObjectCache/LICENSE.txt
index 147bcd6..a169586 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/LICENSE.txt
+++ b/lib/VNLib.Data.Caching.ObjectCache/LICENSE.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2022 Vaughn Nugent
+Copyright (c) 2023 Vaughn Nugent
Contact information
Name: Vaughn Nugent
- Email: public[at]vaughnnugent[dot]com
+ Email: vnpublic@proton.me
Website: https://www.vaughnnugent.com
The software in this repository is licensed under the GNU Affero GPL version 3.0 (or any later version).
diff --git a/lib/VNLib.Data.Caching.ObjectCache/README.md b/lib/VNLib.Data.Caching.ObjectCache/README.md
index 4326223..bf6f032 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/README.md
+++ b/lib/VNLib.Data.Caching.ObjectCache/README.md
@@ -1,8 +1,17 @@
-# VNLib.Data.Caching.Extensions
-*An extension library for rapid VNCache development*
+# VNLib.Data.Caching.ObjectCache
+*A library for developing in-memory or persistent object data caching for client or server application*
-#### Builds
-Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my [website](https://www.vaughnnugent.com/resources/software). All tar-gzip (.tgz) files will have an associated .sha384 appended checksum of the desired download file.
+**This library has no 3rd-party dependencies**
+
+## Builds
+Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my website (link below).
+
+## Docs and Guides
+Documentation, specifications, and setup guides are available on my website.
+
+[Docs and Articles](https://www.vaughnnugent.com/resources/software/articles?tags=docs,_VNLib.Data.Caching.ObjectCache)
+[Builds and Source](https://www.vaughnnugent.com/resources/software/modules/VNLib.Data.Caching)
+[Nuget Feeds](https://www.vaughnnugent.com/resources/software/modules)
## License
Source files in for this project are licensed to you under the GNU Affero General Public License (or any later version). See the LICENSE files for more information. \ No newline at end of file
diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCache.cs b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCache.cs
index 5e28dde..525227c 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCache.cs
+++ b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCache.cs
@@ -119,7 +119,7 @@ namespace VNLib.Data.Caching.ObjectCache
//Get the stored blob
entry = node.ValueRef.Value;
- //Update the
+ //Update the node vaule with the new key and the same entry
node.Value = new KeyValuePair<string, CacheEntry>(newId, entry);
//Add to end of list
diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/CacheBucketHandle.cs b/lib/VNLib.Data.Caching.ObjectCache/src/CacheBucketHandle.cs
index f9c1f17..4b88957 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/src/CacheBucketHandle.cs
+++ b/lib/VNLib.Data.Caching.ObjectCache/src/CacheBucketHandle.cs
@@ -75,7 +75,7 @@ namespace VNLib.Data.Caching.ObjectCache
/// </summary>
/// <param name="other">The other handle to compare</param>
/// <returns>True if the handles hold a referrence to the same bucket</returns>
- public bool Equals(CacheBucketHandle other) => _bucket?.Equals(other._bucket) ?? false;
+ public bool Equals(CacheBucketHandle other) => ReferenceEquals(_bucket, other._bucket);
/// <summary>
/// Determines if the other handle instance is equal to the current. Handles are
/// equal iff the underlying bucket referrence is equal.
diff --git a/lib/VNLib.Data.Caching/LICENSE.txt b/lib/VNLib.Data.Caching/LICENSE.txt
index 147bcd6..a169586 100644
--- a/lib/VNLib.Data.Caching/LICENSE.txt
+++ b/lib/VNLib.Data.Caching/LICENSE.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2022 Vaughn Nugent
+Copyright (c) 2023 Vaughn Nugent
Contact information
Name: Vaughn Nugent
- Email: public[at]vaughnnugent[dot]com
+ Email: vnpublic@proton.me
Website: https://www.vaughnnugent.com
The software in this repository is licensed under the GNU Affero GPL version 3.0 (or any later version).
diff --git a/lib/VNLib.Data.Caching/README.md b/lib/VNLib.Data.Caching/README.md
index 41d2f8f..32f66f0 100644
--- a/lib/VNLib.Data.Caching/README.md
+++ b/lib/VNLib.Data.Caching/README.md
@@ -1,8 +1,17 @@
# VNLib.Data.Caching
*Data structures and abstractions for implementing fast and reliable netwokred key-value data-stores*
-#### Builds
-Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my [website](https://www.vaughnnugent.com/resources/software). All tar-gzip (.tgz) files will have an associated .sha384 appended checksum of the desired download file.
+**This library has no 3rd-party dependencies**
+
+## Builds
+Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my website (link below).
+
+## Docs and Guides
+Documentation, specifications, and setup guides are available on my website.
+
+[Docs and Articles](https://www.vaughnnugent.com/resources/software/articles?tags=docs,_VNLib.Data.Caching)
+[Builds and Source](https://www.vaughnnugent.com/resources/software/modules/VNLib.Data.Caching)
+[Nuget Feeds](https://www.vaughnnugent.com/resources/software/modules)
## License
-Source files in for this project are licensed to you under the GNU Affero General Public License (or any later version). See the LICENSE files for more information. \ No newline at end of file
+Source files in for this project are licensed to you under the GNU Affero General Public License (or any later version). See the LICENSE file for more information. \ No newline at end of file
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
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/LICENSE.txt b/lib/VNLib.Plugins.Extensions.VNCache/LICENSE.txt
index 147bcd6..a169586 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/LICENSE.txt
+++ b/lib/VNLib.Plugins.Extensions.VNCache/LICENSE.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2022 Vaughn Nugent
+Copyright (c) 2023 Vaughn Nugent
Contact information
Name: Vaughn Nugent
- Email: public[at]vaughnnugent[dot]com
+ Email: vnpublic@proton.me
Website: https://www.vaughnnugent.com
The software in this repository is licensed under the GNU Affero GPL version 3.0 (or any later version).
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/README.md b/lib/VNLib.Plugins.Extensions.VNCache/README.md
index 9799fec..157e5ad 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/README.md
+++ b/lib/VNLib.Plugins.Extensions.VNCache/README.md
@@ -1,8 +1,18 @@
# VNLib.Plugins.Extensions.VNCache
*An extension library for configuring and managing a IGlobalCache connection against a VNCache cluster on a plugin*
-#### Builds
-Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my [website](https://www.vaughnnugent.com/resources/software). All tar-gzip (.tgz) files will have an associated .sha384 appended checksum of the desired download file.
+### Dependency notice
+This library depends on the VNLib.Net.Rest.Client library which requires RestSharp.
+
+## Builds
+Debug build w/ symbols & xml docs, release builds, NuGet packages, and individually packaged source code are available on my website (link below).
+
+## Docs and Guides
+Documentation, specifications, and setup guides are available on my website.
+
+[Docs and Articles](https://www.vaughnnugent.com/resources/software/articles?tags=docs,_VNLib.Plugins.Extensions.VNCache)
+[Builds and Source](https://www.vaughnnugent.com/resources/software/modules/VNLib.Data.Caching)
+[Nuget Feeds](https://www.vaughnnugent.com/resources/software/modules)
## License
Source files in for this project are licensed to you under the GNU Affero General Public License (or any later version). See the LICENSE files for more information. \ No newline at end of file
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/EntityCacheExtensions.cs b/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/EntityCacheExtensions.cs
index 79bb4fc..73baa4a 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/EntityCacheExtensions.cs
+++ b/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/EntityCacheExtensions.cs
@@ -100,6 +100,7 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
KeyGen = keyGen;
}
+ ///<inheritdoc/>
public override Task AddOrUpdateAsync<T>(string key, string? newKey, T value, CancellationToken cancellation)
{
_ = key ?? throw new ArgumentNullException(nameof(key));
@@ -113,6 +114,7 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
return cache.AddOrUpdateAsync(primary, secondary, value, cancellation);
}
+ ///<inheritdoc/>
public override Task DeleteAsync(string key, CancellationToken cancellation)
{
_ = key ?? throw new ArgumentNullException(nameof(key));
@@ -121,6 +123,7 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
return cache.DeleteAsync(scoped, cancellation);
}
+ ///<inheritdoc/>
public override Task<T> GetAsync<T>(string key, CancellationToken cancellation)
{
_ = key ?? throw new ArgumentNullException(nameof(key));
@@ -131,6 +134,7 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
return cache.GetAsync<T?>(scoped, cancellation);
}
+ ///<inheritdoc/>
public override Task<T> GetAsync<T>(string key, ICacheObjectDeserialzer deserializer, CancellationToken cancellation)
{
_ = key ?? throw new ArgumentNullException(nameof(key));
@@ -141,6 +145,7 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
return cache.GetAsync<T?>(scoped, deserializer, cancellation);
}
+ ///<inheritdoc/>
public override Task AddOrUpdateAsync<T>(string key, string? newKey, T value, ICacheObjectSerialzer serialzer, CancellationToken cancellation)
{
_ = key ?? throw new ArgumentNullException(nameof(key));
@@ -153,6 +158,31 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
return cache.AddOrUpdateAsync(primary, secondary, value, serialzer, cancellation);
}
+
+ ///<inheritdoc/>
+ public override Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation)
+ {
+ _ = key ?? throw new ArgumentNullException(nameof(key));
+
+ //Compute the key for the id
+ string scoped = KeyGen.ComputedKey(key);
+
+ return cache.GetAsync(scoped, rawData, cancellation);
+ }
+
+ ///<inheritdoc/>
+ public override Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation)
+ {
+ _ = key ?? throw new ArgumentNullException(nameof(key));
+
+ //Compute primary key from id
+ string primary = KeyGen.ComputedKey(key);
+
+ //If newkey exists, compute the secondary key
+ string? secondary = newKey != null ? KeyGen.ComputedKey(newKey) : null;
+
+ return cache.AddOrUpdateAsync(primary, secondary, rawData, serialzer, cancellation);
+ }
}
}
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/ScopedCache.cs b/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/ScopedCache.cs
index da2f78a..c26fd1a 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/ScopedCache.cs
+++ b/lib/VNLib.Plugins.Extensions.VNCache/src/DataModel/ScopedCache.cs
@@ -60,5 +60,11 @@ namespace VNLib.Plugins.Extensions.VNCache.DataModel
///<inheritdoc/>
public abstract Task AddOrUpdateAsync<T>(string key, string? newKey, T value, ICacheObjectSerialzer serialzer, CancellationToken cancellation);
+
+ ///<inheritdoc/>
+ public abstract Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation);
+
+ ///<inheritdoc/>
+ public abstract Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation);
}
}
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/src/MemoryCache.cs b/lib/VNLib.Plugins.Extensions.VNCache/src/MemoryCache.cs
index a62b5db..e4c95a4 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/src/MemoryCache.cs
+++ b/lib/VNLib.Plugins.Extensions.VNCache/src/MemoryCache.cs
@@ -176,5 +176,33 @@ namespace VNLib.Plugins.Extensions.VNCache
return default;
}
+
+ ///<inheritdoc/>
+ public async Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation)
+ {
+ Check();
+
+ //Get the bucket from the desired key
+ IBlobCacheBucket bucket = _memCache.GetBucket(key);
+
+ //Obtain cache handle
+ using CacheBucketHandle handle = await bucket.WaitAsync(cancellation);
+
+ //Try to read the value
+ if (handle.Cache.TryGetValue(key, out CacheEntry entry))
+ {
+ //Set result data
+ rawData.SetData(entry.GetDataSegment());
+ }
+ }
+
+ ///<inheritdoc/>
+ public Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation)
+ {
+ Check();
+
+ //Update object data
+ return _memCache.AddOrUpdateObjectAsync(key, newKey, static b => b.GetData(), rawData, default, cancellation).AsTask();
+ }
}
} \ No newline at end of file
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/src/RemoteBackedMemoryCache.cs b/lib/VNLib.Plugins.Extensions.VNCache/src/RemoteBackedMemoryCache.cs
index ffe9108..ff73f19 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/src/RemoteBackedMemoryCache.cs
+++ b/lib/VNLib.Plugins.Extensions.VNCache/src/RemoteBackedMemoryCache.cs
@@ -192,20 +192,61 @@ namespace VNLib.Plugins.Extensions.VNCache
{
CheckConnected();
- DateTime currentTime = DateTime.UtcNow;
-
//Alloc serialzation buffer
using AddOrUpdateBuffer buffer = new (Client.Config.BufferHeap);
//Serialze the value
serialzer.Serialize(value, buffer);
+ //Call update on raw data
+ await AddOrUpdateAsync(key, newKey, buffer, cancellation);
+ }
+
+ ///<inheritdoc/>
+ public override async Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation)
+ {
+ CheckConnected();
+
+ IBlobCacheBucket bucket = _memCache.GetBucket(key);
+
+ //Obtain cache handle
+ using (CacheBucketHandle handle = await bucket.WaitAsync(cancellation))
+ {
+ //Try to read the value
+ if (handle.Cache.TryGetValue(key, out CacheEntry entry))
+ {
+ rawData.SetData(entry.GetDataSegment());
+ return;
+ }
+ }
+
+ //Get the object from the server
+ await Client.GetObjectAsync(key, rawData, cancellation);
+
+ //See if object data was set
+ if (rawData.GetData().IsEmpty)
+ {
+ return;
+ }
+
+ //Update local cache
+ await _memCache.AddOrUpdateObjectAsync(key, null, static b => b.GetData(), rawData, DateTime.UtcNow, CancellationToken.None);
+ }
+
+ ///<inheritdoc/>
+ public override async Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation)
+ {
+ CheckConnected();
+
+ DateTime currentTime = DateTime.UtcNow;
+
try
{
//Update remote first, and if exceptions are raised, do not update local cache
- await Client.AddOrUpdateObjectAsync(key, newKey, (IObjectData)buffer, cancellation);
+ await Client.AddOrUpdateObjectAsync(key, newKey, rawData, cancellation);
- await _memCache.AddOrUpdateObjectAsync(key, newKey, static b => b.GetData(), buffer, currentTime, CancellationToken.None);
+ //Safe to update local cache
+ await _memCache.AddOrUpdateObjectAsync(key, newKey, static b => b.GetData(), rawData, currentTime, CancellationToken.None);
}
catch
{
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);
}
-
+
+ ///<inheritdoc/>
+ 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);
+ }
+
+ ///<inheritdoc/>
+ 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
{
diff --git a/lib/VNLib.Plugins.Extensions.VNCache/src/VnGlobalCache.cs b/lib/VNLib.Plugins.Extensions.VNCache/src/VnGlobalCache.cs
index 981786d..786a085 100644
--- a/lib/VNLib.Plugins.Extensions.VNCache/src/VnGlobalCache.cs
+++ b/lib/VNLib.Plugins.Extensions.VNCache/src/VnGlobalCache.cs
@@ -172,5 +172,17 @@ namespace VNLib.Plugins.Extensions.VNCache
{
return _client.GetAsync<T>(key, deserializer, cancellation);
}
+
+ ///<inheritdoc/>
+ public Task GetAsync(string key, IObjectData rawData, CancellationToken cancellation)
+ {
+ return _client.GetAsync(key, rawData, cancellation);
+ }
+
+ ///<inheritdoc/>
+ public Task AddOrUpdateAsync(string key, string? newKey, IObjectData rawData, ICacheObjectSerialzer serialzer, CancellationToken cancellation)
+ {
+ return _client.AddOrUpdateAsync(key, newKey, rawData, serialzer, cancellation);
+ }
}
} \ No newline at end of file