From e25666bbf408ff33c09dc8e2c5fe2d052363595f Mon Sep 17 00:00:00 2001 From: vnugent Date: Wed, 29 Nov 2023 00:17:13 -0500 Subject: Integrate FBM core changes for immutable client instances --- .../src/Clustering/CacheNodeReplicationMaanger.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/ObjectCacheServer/src/Clustering') diff --git a/plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs b/plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs index dbfd091..a240dde 100644 --- a/plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs +++ b/plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs @@ -65,7 +65,7 @@ namespace VNLib.Data.Caching.ObjectCache.Server.Clustering private readonly NodeConfig _nodeConfig; private readonly ICacheStore _cacheStore; private readonly ICachePeerAdapter _peerAdapter; - private readonly FBMClientConfig _replicationClientConfig; + private readonly FBMClientFactory _clientFactory; private readonly bool _isDebug; @@ -79,12 +79,16 @@ namespace VNLib.Data.Caching.ObjectCache.Server.Clustering _peerAdapter = plugin.GetOrCreateSingleton(); //Init fbm config with fixed message size - _replicationClientConfig = FBMDataCacheExtensions.GetDefaultConfig( + FBMClientConfig clientConfig = FBMDataCacheExtensions.GetDefaultConfig( (plugin as ObjectCacheServerEntry)!.ListenerHeap, MAX_MESSAGE_SIZE, debugLog: plugin.IsDebug() ? plugin.Log : null ); + //Init ws fallback factory and client factory + FBMFallbackClientWsFactory wsFactory = new(); + _clientFactory = new(in clientConfig, wsFactory); + _plugin = plugin; _isDebug = plugin.IsDebug(); _log = plugin.Log.CreateScope(LOG_SCOPE_NAME); @@ -149,7 +153,7 @@ namespace VNLib.Data.Caching.ObjectCache.Server.Clustering _ = newPeer ?? throw new ArgumentNullException(nameof(newPeer)); //Setup client - FBMClient client = new(_replicationClientConfig); + FBMClient client = _clientFactory.CreateClient(); //Add peer to monitor _peerAdapter.OnPeerListenerAttached(newPeer); -- cgit