/// <summary>
 /// 设置服务命令管理者。
 /// </summary>
 /// <param name="builder">Rpc服务构建者。</param>
 /// <param name="configInfo">ZooKeeper设置信息。</param>
 /// <returns>服务构建者。</returns>
 public static IServiceBuilder UseConsulCommandManager(this IServiceBuilder builder, ConfigInfo configInfo)
 {
     return(builder.UseCommandManager(provider =>
     {
         var result = new ConsulServiceCommandManager(
             configInfo,
             provider.GetRequiredService <ISerializer <byte[]> >(),
             provider.GetRequiredService <ISerializer <string> >(),
             provider.GetRequiredService <IClientWatchManager>(),
             provider.GetRequiredService <IServiceEntryManager>(),
             provider.GetRequiredService <ILogger <ConsulServiceCommandManager> >());
         return result;
     }));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 设置服务命令管理者。
 /// </summary>
 /// <param name="builder">Rpc服务构建者。</param>
 /// <param name="configInfo">ZooKeeper设置信息。</param>
 /// <returns>服务构建者。</returns>
 public ConsulModule UseConsulCommandManager(ContainerBuilderWrapper builder, ConfigInfo configInfo)
 {
     UseCommandManager(builder, provider =>
     {
         var result = new ConsulServiceCommandManager(
             GetConfigInfo(configInfo),
             provider.GetRequiredService <ISerializer <byte[]> >(),
             provider.GetRequiredService <ISerializer <string> >(),
             provider.GetRequiredService <IServiceRouteManager>(),
             provider.GetRequiredService <IClientWatchManager>(),
             provider.GetRequiredService <IServiceEntryManager>(),
             provider.GetRequiredService <ILogger <ConsulServiceCommandManager> >());
         return(result);
     });
     return(this);
 }