aboutsummaryrefslogtreecommitdiff
path: root/plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-11-29 00:17:13 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2023-11-29 00:17:13 -0500
commite25666bbf408ff33c09dc8e2c5fe2d052363595f (patch)
treece7a7290e8f013afdc38529b1be7fd8de0827ffd /plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs
parent78a47dd6887fbbe33d9526194b6af300a72448fa (diff)
Integrate FBM core changes for immutable client instances
Diffstat (limited to 'plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs')
-rw-r--r--plugins/ObjectCacheServer/src/Clustering/CacheNodeReplicationMaanger.cs10
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);