mark4z commented on code in PR #389:
URL: https://github.com/apache/dubbo-go-pixiu/pull/389#discussion_r849493701


##########
pkg/adapter/dubboregistry/registry/nacos/service_listener.go:
##########
@@ -58,11 +64,76 @@ func newNacosSrvListener(url *dubboCommon.URL, client 
naming_client.INamingClien
                client:          client,
                exit:            make(chan struct{}),
                adapterListener: adapterListener,
+               instanceMap:     map[string]nacosModel.Instance{},
        }
 }
 
-func (z *serviceListener) Notify(e *dubboRegistry.ServiceEvent) {
-       bkConfig, methods, location, err := 
registry.ParseDubboString(e.Service.String())
+func (z *serviceListener) Callback(services []nacosModel.SubscribeService, err 
error) {
+       if err != nil {
+               logger.Errorf("nacos subscribe callback error:%s", err.Error())
+               return
+       }
+
+       addInstances := make([]nacosModel.Instance, 0, len(services))
+       delInstances := make([]nacosModel.Instance, 0, len(services))
+       updateInstances := make([]nacosModel.Instance, 0, len(services))
+       newInstanceMap := make(map[string]nacosModel.Instance, len(services))
+
+       z.cacheLock.Lock()

Review Comment:
   考虑一下channel?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to