Esempio n. 1
0
        public ClusterController(ClientConfiguration clientConfig,
                                 Func <IConnectionPool, IIOService> ioServiceFactory,
                                 Func <PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory,
                                 Func <string, string, IConnectionPool, ITypeTranscoder, ISaslMechanism> saslFactory,
                                 IByteConverter converter,
                                 ITypeTranscoder transcoder)
        {
            _clientConfig          = clientConfig;
            _ioServiceFactory      = ioServiceFactory;
            _connectionPoolFactory = connectionPoolFactory;
            _saslFactory           = saslFactory;
            Converter  = converter;
            Transcoder = transcoder;
            Initialize();

            if (clientConfig.EnableDeadServiceUriPing)
            {
                _clusterMonitor = new ClusterMonitor(this);
                _clusterMonitor.StartMonitoring();
            }

            LastConfigCheckedTime = DateTime.Now;
            if (Configuration.EnableConfigHeartBeat)
            {
                _configMonitor = new ConfigMonitor(this);
                _configMonitor.StartMonitoring();
            }

            _configThread = new Thread(ProcessConfig)
            {
                Name         = "CT",
                IsBackground = true
            };
            _configThread.Start();
        }
        public ClusterController(ClientConfiguration clientConfig,
                                 Func <IConnectionPool, IIOService> ioServiceFactory,
                                 Func <PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory,
                                 Func <string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory,
                                 IByteConverter converter,
                                 ITypeTranscoder transcoder)
        {
            _clientConfig          = clientConfig;
            _ioServiceFactory      = ioServiceFactory;
            _connectionPoolFactory = connectionPoolFactory;
            _saslFactory           = saslFactory;
            Converter  = converter;
            Transcoder = transcoder;
            Initialize();

            if (clientConfig.EnableDeadServiceUriPing)
            {
                _clusterMonitor = new ClusterMonitor(this);
                _clusterMonitor.StartMonitoring();
            }
        }