コード例 #1
0
 /// <summary>
 /// 设置服务命令管理者。
 /// </summary>
 /// <param name="builder">Rpc服务构建者。</param>
 /// <param name="configInfo">ZooKeeper设置信息。</param>
 /// <returns>服务构建者。</returns>
 public static IServiceBuilder UseZooKeeperCommandManager(this IServiceBuilder builder, ConfigInfo configInfo)
 {
     return(builder.UseCommandManager(provider =>
     {
         var result = new ZookeeperServiceCommandManager(
             GetConfigInfo(configInfo),
             provider.GetRequiredService <ISerializer <byte[]> >(),
             provider.GetRequiredService <ISerializer <string> >(),
             provider.GetRequiredService <IServiceRouteManager>(),
             provider.GetRequiredService <IServiceEntryManager>(),
             provider.GetRequiredService <ILogger <ZookeeperServiceCommandManager> >(),
             provider.GetRequiredService <IZookeeperClientProvider>());
         return result;
     }));
 }
コード例 #2
0
 /// <summary>
 /// 设置服务命令管理者。
 /// </summary>
 /// <param name="builder">Rpc服务构建者。</param>
 /// <param name="configInfo">ZooKeeper设置信息。</param>
 /// <returns>服务构建者。</returns>
 public ZookeeperModule UseZooKeeperCommandManager(ContainerBuilderWrapper builder, ConfigInfo configInfo)
 {
     UseCommandManager(builder, provider =>
     {
         var result = new ZookeeperServiceCommandManager(
             GetConfigInfo(configInfo),
             provider.GetRequiredService <ISerializer <byte[]> >(),
             provider.GetRequiredService <ISerializer <string> >(),
             provider.GetRequiredService <IServiceRouteManager>(),
             provider.GetRequiredService <IServiceEntryManager>(),
             provider.GetRequiredService <ILogger <ZookeeperServiceCommandManager> >(),
             provider.GetRequiredService <IZookeeperClientProvider>());
         return(result);
     });
     return(this);
 }