aboutsummaryrefslogtreecommitdiff
path: root/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-02-13 14:46:35 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-02-13 14:46:35 -0500
commit456ead9bc8b0f61357bae93152ad0403c4940101 (patch)
tree74cddbca5eebcec7948e706bd7b742b19e55eeb6 /lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs
parenta481d63f964a5d5204cac2e95141f37f9a28d573 (diff)
fix: #1 shared cluster index on linux & latested core updates
Diffstat (limited to 'lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs')
-rw-r--r--lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs
index 4cacb3f..1681256 100644
--- a/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs
+++ b/lib/VNLib.Data.Caching.ObjectCache/src/BlobCacheExtensions.cs
@@ -252,11 +252,27 @@ namespace VNLib.Data.Caching.ObjectCache
/// <param name="objectId">The id of the object to delete</param>
/// <param name="cancellation">A token to cancel the async lock await</param>
/// <returns>A task that completes when the item has been deleted</returns>
- public static async ValueTask<bool> DeleteObjectAsync(this IBlobCacheTable table, string objectId, CancellationToken cancellation = default)
+ public static ValueTask<bool> DeleteObjectAsync(this IBlobCacheTable table, string objectId, CancellationToken cancellation = default)
{
+ ArgumentNullException.ThrowIfNull(table);
+
//Try to get the bucket that the id should belong to
IBlobCacheBucket bucket = table.GetBucket(objectId);
+ return DeleteObjectAsync(bucket, objectId, cancellation);
+ }
+
+ /// <summary>
+ /// Asynchronously deletes a previously stored item
+ /// </summary>
+ /// <param name="bucket"></param>
+ /// <param name="objectId">The id of the object to delete</param>
+ /// <param name="cancellation">A token to cancel the async lock await</param>
+ /// <returns>A task that completes when the item has been deleted</returns>
+ public static async ValueTask<bool> DeleteObjectAsync(this IBlobCacheBucket bucket, string objectId, CancellationToken cancellation = default)
+ {
+ ArgumentNullException.ThrowIfNull(bucket);
+
//Wait for the bucket
IBlobCache cache = await bucket.ManualWaitAsync(cancellation);