diff options
Diffstat (limited to 'plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs')
-rw-r--r-- | plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs | 10 |
1 files changed, 7 insertions, 3 deletions
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<PeerDiscoveryManager>(); //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); |