Пример #1
0
 public FailoverClusterClient(RemoteClientConfiguration configuration)
 {
     Configuration = configuration;
     MasterNode    = (RemoteEngineClient <T>)configuration.GetClient <T>();
     // Todo move to config
     _dispatchStrategy = new RoundRobinQueryDispatchStrategy <T>(Nodes);
 }
Пример #2
0
        public static FailoverClusterClient <T> CreateFromNetwork(RemoteClientConfiguration baseConfiguration)
        {
            var client     = new FailoverClusterClient <T>(baseConfiguration);
            var initClient = (RemoteEngineClient <T>)baseConfiguration.GetClient <T>();
            var response   = initClient.SendAndRecieve <ClusterInfoResponse>(new ClusterInfoRequest());

            client.UpdateClusterInformation(response.ClusterInfo);
            return(client);
        }
Пример #3
0
        RemoteEngineClient <T> CreateNode(string host, int port)
        {
            var nodeConfig = new RemoteClientConfiguration();

            nodeConfig.DedicatedPool  = Configuration.DedicatedPool;
            nodeConfig.MaxConnections = Configuration.MaxConnections;
            nodeConfig.Host           = host;
            nodeConfig.Port           = port;
            var node = (RemoteEngineClient <T>)nodeConfig.GetClient <T>();

            Nodes.Add(node);
            return(node);
        }