public IRouteCoordinator Create() { var connectionStr = NRpcConfigWatcher.CurrentConfig.Zookeeper.Connection; var parentName = NRpcConfigWatcher.CurrentConfig.Zookeeper.ParentName; Ensure.NotNullAndNotEmpty(connectionStr, "NRpc:Zookeeper:Connection"); Ensure.NotNullAndNotEmpty(parentName, "NRpc:Zookeeper:ParentName"); var option = new RouteCoordinatorOption { ConnectionString = connectionStr, ParentName = parentName }; return(new ZkCoordinator(option)); }
public IRouteCoordinator Create() { var config = _remoteEndPointConfigProvider.GetConfig(); var connectionStr = config?.Zookeeper?.Connection; var parentName = config?.Zookeeper?.ParentName; Ensure.NotNullAndNotEmpty(connectionStr, "NetCoreRpc:Zookeeper:Connection"); Ensure.NotNullAndNotEmpty(parentName, "NetCoreRpc:Zookeeper:ParentName"); var option = new RouteCoordinatorOption { ConnectionString = connectionStr, ParentName = parentName }; return(new ZkCoordinator(option)); }
public ZkManager(RouteCoordinatorOption zkOption, Func <WatchedEvent, ZkManager, Task> changeEvent) { _zkOption = zkOption; _changeEvent = changeEvent; _zooKeeper = CreateZk(); }
public ZkCoordinator(RouteCoordinatorOption routeCoordinatorOption) { _routeCoordinatorOption = routeCoordinatorOption; _zkManager = new ZkManager(routeCoordinatorOption, NodeChangedAsync); }