From d2d812213b99ee17f9433f81871b694c4053ff23 Mon Sep 17 00:00:00 2001 From: vnugent Date: Thu, 2 Nov 2023 01:50:05 -0400 Subject: also carried away --- plugins/ObjectCacheServer/src/Cache/CacheStore.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'plugins/ObjectCacheServer/src/Cache/CacheStore.cs') diff --git a/plugins/ObjectCacheServer/src/Cache/CacheStore.cs b/plugins/ObjectCacheServer/src/Cache/CacheStore.cs index 5795222..02ed9b1 100644 --- a/plugins/ObjectCacheServer/src/Cache/CacheStore.cs +++ b/plugins/ObjectCacheServer/src/Cache/CacheStore.cs @@ -27,6 +27,7 @@ using System.Threading; using System.Threading.Tasks; using VNLib.Utils.Logging; +using VNLib.Net.Messaging.FBM; using VNLib.Plugins; using VNLib.Plugins.Extensions.Loading; @@ -43,7 +44,7 @@ namespace VNLib.Data.Caching.ObjectCache.Server.Cache /// /// Gets the underlying cache listener /// - public BlobCacheListener Listener { get; } + public BlobCacheListener Listener { get; } public CacheStore(PluginBase plugin, IConfigScope config) @@ -53,7 +54,7 @@ namespace VNLib.Data.Caching.ObjectCache.Server.Cache } /// - ValueTask ICacheStore.AddOrUpdateBlobAsync(string objectId, string? alternateId, GetBodyDataCallback bodyData, T state, CancellationToken token) + ValueTask ICacheStore.AddOrUpdateBlobAsync(string objectId, string? alternateId, ObjectDataReader bodyData, T state, CancellationToken token) { return Listener.Cache.AddOrUpdateObjectAsync(objectId, alternateId, bodyData, state, default, token); } @@ -70,7 +71,7 @@ namespace VNLib.Data.Caching.ObjectCache.Server.Cache return Listener.Cache.DeleteObjectAsync(id, token); } - private static BlobCacheListener InitializeCache(ObjectCacheServerEntry plugin, IConfigScope config) + private static BlobCacheListener InitializeCache(ObjectCacheServerEntry plugin, IConfigScope config) { const string CacheConfigTemplate = @" @@ -105,7 +106,7 @@ Cache Configuration: ); //Get the event listener - ICacheListenerEventQueue queue = plugin.GetOrCreateSingleton(); + ICacheListenerEventQueue queue = plugin.GetOrCreateSingleton(); //Get the memory manager ICacheMemoryManagerFactory manager = plugin.GetOrCreateSingleton(); @@ -113,8 +114,10 @@ Cache Configuration: //Load the blob cache table system IBlobCacheTable bc = plugin.LoadMemoryCacheSystem(config, manager, cacheConf); + FallbackFBMMemoryManager fbmMemManager = new(plugin.ListenerHeap); + //Endpoint only allows for a single reader - return new(bc, queue, plugin.Log, plugin.ListenerHeap); + return new(bc, queue, plugin.Log, fbmMemManager); } /* -- cgit