Closed fengyuzheng2020 closed 1 year ago
我在服务器启动的时候初始化好这两个map,并且建立连接 discoveryCache = make(map[string]rpxClient.ServiceDiscovery) xclientCache = make(map[string]rpxClient.XClient) 调用的时候直接取然后调用有问题吗 cacheClientMutex.RLock() c, ok := xclientCache[registerName] cacheClientMutex.RUnlock() c.Call(ctx, method, req, resp)
没问题
我在服务器启动的时候初始化好这两个map,并且建立连接 discoveryCache = make(map[string]rpxClient.ServiceDiscovery) xclientCache = make(map[string]rpxClient.XClient) 调用的时候直接取然后调用有问题吗 cacheClientMutex.RLock() c, ok := xclientCache[registerName] cacheClientMutex.RUnlock() c.Call(ctx, method, req, resp)