Пример #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="clusterToken">token</param>
 /// <param name="logger">日志</param>
 /// <param name="redisConnection">注册中心连接地址</param>
 public ClientStub(string clusterToken, ILog logger, string redisConnection, ITraceChain traceChain) : base(logger)
 {
     ClusterToken           = clusterToken;
     EnableServiceDiscovery = true;
     TraceChain             = traceChain;
     _connectionPool        = new ClientConnectionPool(new ServiceDiscovery(redisConnection));
     this.Functions.Add(uint.MinValue, _connectionPool.RefreshAll);
 }
Пример #2
0
 /// <summary>
 /// 当前模式下使用注册中心发现服务
 /// </summary>
 /// <param name="clusterToken">集群授权码</param>
 /// <param name="redisConnection">注册中心链接地址</param>
 /// <param name="traceChain">链路管理</param>
 internal AbstractChannel(string clusterToken, ILog logger, string redisConnection, ITraceChain traceChain)
 {
     if (string.IsNullOrEmpty(clusterToken))
     {
         throw new ArgumentNullException(nameof(clusterToken));
     }
     _clientStub = new ClientStub(clusterToken, logger, redisConnection, traceChain);
 }
Пример #3
0
 /// <summary>
 /// dotNetty 客户端通讯管理,当前模式下使用注册中心发现服务
 /// </summary>
 /// <param name="clusterToken">集群授权码</param>
 /// <param name="logger">日志</param>
 /// <param name="redisConnection">注册中心redis</param>
 /// <param name="traceChain">链路管理</param>
 public TCPChannel(string clusterToken, ILog logger, string redisConnection, ITraceChain traceChain) : base(clusterToken, logger, redisConnection, traceChain)
 {
 }